Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is a sepia tone created?

What are the basic operations needed to create a sepia tone? My reference point is the perl imagemagick library, so I can easily use any basic operation. I've tried to quantize (making it grayscale), colorize, and then enhance the image but it's still a bit blurry.

like image 961
user83358 Avatar asked Jun 29 '09 23:06

user83358


1 Answers

Sample code of a sepia converter in C# is available in my answer here: What is wrong with this sepia tone conversion algorithm?

The algorithm comes from this page, each input pixel color is transformed in the following way:

outputRed = (inputRed * .393) + (inputGreen *.769) + (inputBlue * .189)
outputGreen = (inputRed * .349) + (inputGreen *.686) + (inputBlue * .168)
outputBlue = (inputRed * .272) + (inputGreen *.534) + (inputBlue * .131)

If any of these output values is greater than 255, you simply set it to 255. These specific values are the values for sepia tone that are recommended by Microsoft.

like image 173
Max Galkin Avatar answered Sep 19 '22 19:09

Max Galkin