开发者

Image/color manipulation formulas [closed]

开发者 https://www.devze.com 2023-01-20 11:22 出处:网络
Closed开发者_开发问答. This question needs to be more focused. It is not currently accepting answers.
Closed开发者_开发问答. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 9 years ago.

Improve this question

I know how to do simple things with images at the pixel level like applying grayscale, sepia, etc. I'd like to find some articles on how to apply saturation, hue, brightness, contrast, etc at the pixel level, and I'm having trouble getting anything useful from my google searches.


Since pixels are usually represented as RGB (red, green, blue) values, it's often more useful to convert them to another color space to manipulate them, e.g. HSB (Hue, Saturation, Brightness) - that way you can change those values individually more easily.

If you search for RGB to HSB conversion you should find examples of how to do it (I think I found some useful code on Wikipedia).

Obviously after you've manipulated the pixels (e.g. multiplying the saturations by 0.2) you then have to convert them back to RGB for display.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号