Einzelnen Beitrag anzeigen

Benutzerbild von jfheins
jfheins

Registriert seit: 10. Jun 2004
Ort: Garching (TUM)
4.579 Beiträge
 
#4

Re: [GR32] How to add intensity?

  Alt 22. Jan 2010, 16:43
I would do something like this:

1. You have the "target color" (full brightness and saturation) and the amount you want to blend (between 0 and 1)

2. For each Pixel do:
2.1: multiply the target color with the brightness of the image pixel
2.2: mix the image pixel and the result from 2.1 together, according to the amount.

(1-x) * image_pixel + x * (color * image_pixel_brightness)

The Brigness of a pixel is calculated by adding up all the components and dividung the result by 3. However, there is an advanced formula that weights the colors differently.
  Mit Zitat antworten Zitat