views:

347

answers:

2

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.

A: 

It's easy if you use the imagemagic command line.

http://www.imagemagick.org/script/convert.php

Use the "-sepia-tone threshold" argument when converting.

Strangely enough, the PerlMagick API doesn't seem to include a method for doing this directly:

http://www.imagemagick.org/script/perl-magick.php

...and no reference to any Sepia method.

the.jxc
Since I have an imagemagick object in perl this isn't the most direct way but it could work... but it doesn't seem to have an option to use other colors for the effect
+1  A: 

Take a look at how it's implemented in the AForge.NET library, the C# code is here.

The basics seem to be

  • transform it to the YIQ color space
  • modify it
  • transform back to RGB

The full alrogithm is in the source code, plus the RGB -> YIQ and YIQ -> RGB transformations are explained.

Matt Warren