如何创造棕褐色调? [英] How is a sepia tone created?
问题描述
创建棕褐色调需要哪些基本操作?我的参考点是perl imagemagick库,所以我可以轻松使用任何基本操作。我试图量化(使其灰度),着色,然后增强图像,但它仍然有点模糊。
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.
推荐答案
我在这里的回答中提供了C#中的棕褐色转换器的示例代码:这种棕褐色调转换算法有什么问题?
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)
如果有的话这些输出值大于255,你只需将它设置为
到255.这些特定值是微软推荐的棕褐色调值,
。
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.
这篇关于如何创造棕褐色调?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!