Pixel math log function not working

Hi,
I have an image based on the red channel of a dual narrowband stack of Andromeda galaxy that I’d like to add to broadband to highlight nebulous regions. The core of the galaxy is very bright in this image so I was trying to reduce it with various methods in Pixel Math, however, it seems whatever I do, the values are basically just scaled. The ratio of the median value of the bright core region / median value of a particular nebulous region is always about the same. One example, I tried log10(1+Ha). The median values in the original Ha were 29.1k / 10.7k = 2.7 and after log transformation were 10.5k / 4.3k = 2.4. I’m not sure how the new pixel values are scaled after transformation (log(29K) is not 10K so it appears there is some scaling factor?) but in reality the ratio should be about 1.1 even if the values are scaled afterwards. I tried log, log10 and ln – all same results. Any thoughts on this?

Thanks,

Andrew

I’m just trying to apply ln/log on image with uniform pixel values, it gives me the right value.
So I don’t see any error in the pixelmath results.

How do you read the value?

On my side, I create a new image and fill with pixels at 50000 (ie, in the [0, 1] range: 0.762951095):

new 100 100 1
fill 50000
save test

I load test as I1 in Pixelmath and type:
ln(I1)
Then I type
stat
in the command line.
That gives me:
23:59:40: B&W layer: Mean: -17731.2, Median: -17731.2,.....

And I can check this is correct:
ln(50000÷65535)*65535 = −17731.23781011

Thanks for the reply. I’m using boxselect to create a box (either over a part of nebula or over the core) and then right click and select “Statistics.”

Visually it looks the same before and after transformation as well.

Before (with autostretch view):

After (with autostretch view):

Is there a better way to get regional pixel values to see if the transformation is sufficient or if I need to modify the formula?

Thanks

Alternatively does anyone have other suggestions of how to reduce/compress the overblown core using Pixel Math since logarithmic compression is not working here? Thanks

I would recommend using the GHS tool, with the user interface.

which may require light reading :slight_smile: Siril - Generalized Hyperbolic Stretch (GHS) Transformations

Okay, will try thanks.