Photoshop channel compositing algorithm?

This topic is 3862 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

This is something of an art question, but I am looking for specific algorithm math here so I guess this is the appropriate forum. In Photoshop, in the composite RGB channel of an RGB image filled with 50% gray, the eyedropper color picker shows all pixels have a value of [r=128, g=128, b=128]. If you isolate the red channel alone, copy the contents, and paste into a new, empty RGB (not grayscale) image, the eyedropper color picker will show all pixels to have a value of [r=149, g=149, b=149]. Does anybody know the specific math of what is happening here? I had always assumed the composite RGB channel was constructed additively, I guess that was naïve haha.

Share on other sites
What you're probably looking at is a greyscale conversion.

If you put three stripes of pure red, green, and blue on-screen, you'll notice that (255,0,0), (0,255,0), and (0,0,255) are not all the same brightness. Maximum blue is not as bright as maximum green. That's largely because our eyes don't pick up these colours in the same intensities.

So when a well-made bit of graphic software like Photoshop converts colour to greyscale, it doesn't do it equally. Green is the most intense, followed by red, and then by blue. I forget the exact scalars used by the RGB colourspace, but it is not (R+G+B)/3. It's more like R*0.35 + G*0.4 + B*0.25.

Photoshop is probably doing that behind the scenes, because you're using 1-channel data, and Photoshop assumes that because it is only one channel, it must be greyscale.

• What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 28
• 16
• 10
• 10
• 11
• Forum Statistics

• Total Topics
634103
• Total Posts
3015539
×