Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

phaelax

colorize image

This topic is 5215 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

what is the formula for colorizing an image? I tried converting to grayscale then multiplying by the color, but that doesn''t give 100% accurate results. And I can''t find any resources on this either.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
you must a HSL or HSB color scheme. L or B stands for luminance or brightness, it''s the same afaik and represents your greyscale level. Just set the saturation and hue, the brightness comes your pixel value. Convert your HSB triplet to a RGB and voilà !

Some code there :
http://www.bobpowell.net/RGBHSB.htm

This is something to read if you are into colors tricks :
http://www.poynton.com/notes/colour_and_gamma/ColorFAQ.html

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
What a bad post, I forgot half of the words. sorry..corrected version below

You must USE a HSL or HSB color scheme. L or B stands for luminance or brightness, it''s the same afaik and represents your greyscale level. Just set the saturation and hue, the brightness comes FROM your pixel value. Convert your HSB triplet to a RGB and voilà !

Some code there :
http://www.bobpowell.net/RGBHSB.htm

This is something to read if you are into colors tricks :
http://www.poynton.com/notes/colour_and_gamma/ColorFAQ.html

Just type in google "hsb hsl" and you''ll find a lot of ressources...

Share this post


Link to post
Share on other sites

  • 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!