Post by Creator » Mon Mar 29, 2010, 19:53
There is a big difference between Desaturation and Black and White filtering. Both of them produce a grayscades image, but the algorithms are quite different. When we deal with color images, each color is defined by tree components: Red (R), Green (G) and Blue (B) (RGB model). According to this model, each color is defined by tree numbers from 0 till 255 (in byte coding), for example, red color = (255, 0, 0), yellow = (255, 255, 0) (combination of red and green), white = (255, 255, 255) and black = (0, 0, 0). After filtering we get only only one grey comonent - C, which is a combination of color components: C =
func(R, G, B).
Black ans white filtering uses the linear combibation of all the color channels: C = a*R + b*G + c*B. If the "Preserve luminocity is switched ON, then the equality a + b + c = 1 is kept. IBy default C = (R + G + B) / 3. Desaturaton uses other algorithm: C = (MAX(R,G,B) + MIN(R,G,B)) / 2. It means that with desaturation, for eample, red and yellow colors will be represented by the same greyvalue. Indeed, C(255, 0, 0) = (MAX(255,0,0) + MIN(255,0,0)) / 2. = (255 + 0) / 2 = 127; C(255, 255, 0) = (MAX(255,255,0) + MIN(255,255,0)) / 2. = (255 + 0) / 2 = 127. With Black and White we get different result: C(255, 0, 0) = (255 + 0 + 0) / 3 = 255 / 3 = 85; C(255, 255, 0) = (255 + 255 + 0) / 3 = 450 / 3 = 150. That's why you can create additional contrast, using Black and White filter.
Let us consider an example:

- Spectrum

- Desatuarted

- Black & White-ed
There is a big difference between Desaturation and Black and White filtering. Both of them produce a grayscades image, but the algorithms are quite different. When we deal with color images, each color is defined by tree components: Red (R), Green (G) and Blue (B) (RGB model). According to this model, each color is defined by tree numbers from 0 till 255 (in byte coding), for example, red color = (255, 0, 0), yellow = (255, 255, 0) (combination of red and green), white = (255, 255, 255) and black = (0, 0, 0). After filtering we get only only one grey comonent - C, which is a combination of color components: C = [i]func[/i](R, G, B).
Black ans white filtering uses the linear combibation of all the color channels: C = a*R + b*G + c*B. If the "Preserve luminocity is switched ON, then the equality a + b + c = 1 is kept. IBy default C = (R + G + B) / 3. Desaturaton uses other algorithm: C = (MAX(R,G,B) + MIN(R,G,B)) / 2. It means that with desaturation, for eample, red and yellow colors will be represented by the same greyvalue. Indeed, C(255, 0, 0) = (MAX(255,0,0) + MIN(255,0,0)) / 2. = (255 + 0) / 2 = 127; C(255, 255, 0) = (MAX(255,255,0) + MIN(255,255,0)) / 2. = (255 + 0) / 2 = 127. With Black and White we get different result: C(255, 0, 0) = (255 + 0 + 0) / 3 = 255 / 3 = 85; C(255, 255, 0) = (255 + 255 + 0) / 3 = 450 / 3 = 150. That's why you can create additional contrast, using Black and White filter.
Let us consider an example:
[attachment=2]spectrum.jpg[/attachment]
[attachment=1]spectrum1.jpg[/attachment]
[attachment=0]spectrum2.jpg[/attachment]