Gimp-Forum.net

Full Version: Can I normalize max pixel intensity of one image to another image?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm using gimp to apply freckle textures to a face texture for a video game. All textures are other peoples' work; I'm just pasting the freckles as a new layer onto the face and colorizing them. This is my first exposure to GIMP. I noticed that the face freckle texture is lighter than the neck freckle texture. As a result, when colorized to the same HTML value and applied to the character model, the neck freckles are much darker than the rest (example). Since the original freckle textures as greyscale, is there a way to normalize the max pixel intensity of the neck freckle texture to that of the face, so that they come out to a balanced intensity?
One way to do this :
1) Use Colors > Threshold on face freckle texture to identify the value of the darkest pixels : drag the black triangle to the right and stop when black pixels start appearing ; this will give you the value of darkest pixels. Cancel the Threshold Tool (no need to apply it).
2) Use Colors > RGB Clip... on neck freckle texture : set the Low limit value to one you have identified at the previous step (you may have to divide this value by 255 if you are working in 8bits, because this filter is working in 32bits floating point)
(05-30-2020, 06:37 AM)tmanni Wrote: [ -> ]One way to do this :
1) Use Colors > Threshold on face freckle texture to identify the value of the darkest pixels : drag the black triangle to the right and stop when black pixels start appearing ; this will give you the value of darkest pixels. Cancel the Threshold Tool (no need to apply it).
2) Use Colors > RGB Clip... on neck freckle texture : set the Low limit value to one you have identified at the previous step (you may have to divide this value by 255 if you are working in 8bits, because this filter is working in 32bits floating point)

Sorry, I'm stuck on step 1. Instead of black pixels appearing I'm getting white pixels to appear, and it seems it's adjusting the threshold as soon as I pull up the window. Did I misunderstand the instruction?

https://www.youtube.com/watch?v=a5193npAnFo
I agree it's hard to see anything with all these transparent pixels Smile

Observe the histogram displayed by the tool: you can see 2 vertical black lines next to each other : this seems your layer has only 2 colors ; the darkest is the one on the left (pointed by the green arrow on the image below)

[attachment=4453]

So, to obtain this value, position the black triangle under this black line and read the value in the green box.

You can also temporary disable the alpha channel for a better visualization ; in the Channels Dock (Windows > Dockable dialogs > Channels), click the eye icon next to the Alpha channel : all pixels will become opaque.
(05-30-2020, 08:05 AM)tmanni Wrote: [ -> ]I agree it's hard to see anything with all these transparent pixels Smile

Observe the histogram displayed by the tool: you can see 2 vertical black lines next to each other : this seems your layer has only 2 colors ; the darkest is the one on the left (pointed by the green arrow on the image below)



So, to obtain this value, position the black triangle under this black line and read the value in the green box.

You can also temporary disable the alpha channel for a better visualization ; in the Channels Dock (Windows > Dockable dialogs > Channels), click the eye icon next to the Alpha channel : all pixels will become opaque.

It looks like the face texture has two populations, with the majority at 96 and a small fraction at 99. The neck has a bit of a spectrum, but with the majority at 99, which is what's causing the apparent difference in intensity. So I should be clipping the face to have a low limit of 99, or the neck to have a high limit of 96, right? The issue is that the RGB clip menu only lets me set the low limit to < 0, or the high limit to > 1. What I want (if I understand correctly) is to set a low limit of 99/255 = 0.388 or a high limit of 96/255 = 0.376. Is that possible?

The most ideal solution would just be to shift every pixel intensity of the neck texture down by 3, so that it has a maximum at 96 (the mode of the face texture) and a small population of even dimmer pixels. Is that achievable?

Thank you very much for taking the time to help!
Actually, it looks like main issue is that there's a strong gradient on the alpha channel. I don't see an alpha clip option that's analogous to RGB clip. Is there a workflow to level out this gradient?

https://imgur.com/LKcpPM7
(05-31-2020, 06:37 PM)Piranha91 Wrote: [ -> ]Actually, it looks like main issue is that there's a strong gradient on the alpha channel. I don't see an alpha clip option that's analogous to RGB clip. Is there a workflow to level out this gradient?

https://imgur.com/LKcpPM7

To edit the alpha channel, you use a Layer mask, which can be seen as an auxiliary black and white later that represents the alpha channel.

Then most tools (except those that depend on color obviously) can be applied to it including the Threshold.