![]() |
VOOZH | about |
Prerequisites:
In this set, we will be converting a colored image to a sepia image. In a sepia image, the Alpha component of the image will be the same as the original image(since the alpha component denotes the transparency). Still, the RGB will be changed, which will be calculated by the following formula.
newRed = 0.393*R + 0.769*G + 0.189*B newGreen = 0.349*R + 0.686*G + 0.168*B newBlue = 0.272*R + 0.534*G + 0.131*B
If any of these output values is greater than 255, simply set it to 255. These specific values are the values for a sepia tone that are recommended by Microsoft.
Note: This code will not run on an online IDE as it needs an image on a disk.