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.jpg (62.97 KiB) Viewed 23723 times spectrum.jpg](./download/file.php?id=96&t=1&sid=cd3b5f55005b7bfbebb36587eb4e1ada)
- Spectrum
![spectrum1.jpg (13.65 KiB) Viewed 23723 times spectrum1.jpg](./download/file.php?id=97&t=1&sid=cd3b5f55005b7bfbebb36587eb4e1ada)
- Desatuarted
![spectrum2.jpg (14.18 KiB) Viewed 23723 times spectrum2.jpg](./download/file.php?id=98&t=1&sid=cd3b5f55005b7bfbebb36587eb4e1ada)
- 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]