How is a sepia tone created?

后端 未结 4 1053
独厮守ぢ
独厮守ぢ 2020-12-28 20:24

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 quan

4条回答
  •  感情败类
    2020-12-28 20:45

    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.

提交回复
热议问题