Jump to content
  • Advertisement
Sign in to follow this  
rgoer

Photoshop channel compositing algorithm?

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!