Gimp-Forum.net
Why is "Channel to Selection" brighter than same extracted channel? - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: Why is "Channel to Selection" brighter than same extracted channel? (/Thread-Why-is-Channel-to-Selection-brighter-than-same-extracted-channel)



Why is "Channel to Selection" brighter than same extracted channel? - ChameleonScales - 07-12-2020

As shown below, an extracted channel (here blue) gives a brighter result when using the "Channel to Selection" context menu item and creating a mask from that selection compared to using Colors>Components>Decompose or Color>Components>Extract Component (which both give the correct result):

Original:
[Image: Go0c41f.jpg]

Extracted blue channel:
[Image: IX94zby.jpg]

Channel to Selection (on blue):
[Image: 9LQMo76.jpg]

Is this intended and what is the reason?


RE: Why is "Channel to Selection" brighter than same extracted channel? - mholder - 07-12-2020

Just a guess, but it may have something to do with running a gamma correction before and forgetting to reapply it later

If you open the brighter image and run a levels adjustment with the middle slider setting of around .45 then it looks like the darker one. Normal gamma is I think 2.2, and the reciprocal is .45 adjustment

Image about encoding and decoding gamma.
[attachment=4642]
http://blog.johnnovak.net/2016/09/21/what-every-coder-should-know-about-gamma/

Again, this is just a guess, but it seems quite a coincidence that running a gamma adjustment of around .45 (actually it is .45454545...) makes the lighter one match the darker one.


RE: Why is "Channel to Selection" brighter than same extracted channel? - Ofnuts - 07-13-2020

https://graphicdesign.stackexchange.com/questions/138689/gimp-why-does-channel-to-selection-give-such-bright-values


RE: Why is "Channel to Selection" brighter than same extracted channel? - ChameleonScales - 07-17-2020

Thanks for your answer, and sorry for the StackExchange duplicate. I made a wrong assumption on my chances of getting an answer here compared to S.E. What a dummy.
I should probably keep it in one place so I paste the StackExchange conversation below and will delete my post on Stack Exchange in a while (after I warn the repliers of it).

on StackExchange we Wrote:
xenoid Wrote:I assume that after "Channel to selection" you bucket-filled the selection with I white on a black layer.

On Gimp 2.8 the behavior is as you expect(*). 2.8 works all over with 8-bit gamma-corrected values (so that there are more values to describe the dark tones).

In 2.10 things are different. Internally all computation is done in floating-point, using non-gamma-corrected values. When you copy the channel to a selection the plain channel data is copied, and since the selection is not really an image, there is no reason to gamma-correct it.

There is still a way to apply this gamma-correction, though. Assuming you have a selection from the Blue channel:

    Create a layer filled with black
    Add a new layer, and bucket fill the selection with white (you get the "too-light" result)
    Change the blend mode of the white layer from Normal to Normal (legacy) and you get your expected result (basically the "legacy" blend modes skip the gamma-correction).

(*) "Correct" is a bit strong here. There are plenty of ways to create monochrome images, all as a valid as the others.

I Wrote:Thanks. I did not create a white or black layer, I simply did Add Layer Mask and checked "Selection" but I'm sure it's the same.

joojaa Wrote:Are you sure its gamma corrected? And not inverse gamma corrected or profile corrected? Also its correctish assuming you manipulate images that are created with realworld physics and viewed with human eyes; Yes... But you might not

I Wrote:I did not apply a gamma correction, at least not knowingly. Is there a setting I may not be aware of?

xenoid Wrote:No that's just the way things work in 2.10, and why they kept the "legacy" blend modes for when you depend on the historical behavior (which itself is wrong in many occasions, they didn't change this without good reasons)


All that said, I noticed the same difference between using the "Mask from Selection"  radio button (when adding a mask) and, on the other hand, copying & pasting the same selection into a mask.

To clarify what I mean by copying & pasting:
- enter a selection by hitting Shift+Q (Quick mask mode, confusing name to me)
- select everything with Ctrl+A
- copy
- exit the selection with Shift+Q
- paste

Even if it's a matter of gamma correction, I don't understand why we would want these 2 approaches to behave differently. But I'm sure there's a reason!


RE: Why is "Channel to Selection" brighter than same extracted channel? - Ofnuts - 07-18-2020

At the risk of revealing some of my secret identities, consider that SE's Xenoid and G-F.n's Ofnuts could be the same person.


RE: Why is "Channel to Selection" brighter than same extracted channel? - ChameleonScales - 07-18-2020

I suspected that but I wasn't 100% sure. Now my evil plan can be accomplished, haha!
Anyway I take it as an ok for deletion on S.E.

Edit: Actually when I click the delete button it says I'm not permitted to do it because it has gotten an answer, so... that settles it.