Page 1 of 1

Sepia effect with imagick like in photoshop

Posted: 2014-09-06T01:39:14-07:00
by bseeleib
I'm converting a image from color to sepia with imagick+php, using the sepiaToneImage function. While the effect is good i would like it be more like the photoshop sepia filter (pictured below). Is this possible and how? I've already tried modulateImage but i couldn't get nere the photoshop effect. As far as i unterstand it, imagick is converting the picture to grayscale and then applies color, ist it possible to convert to sepia without grayscale (as this might be the fix)?

Example picture:
Image

Code: Select all

$img = new Imagick("test.jpg");
$img->setImageFormat('jpeg');
$img->sepiaToneImage(80);
header("Content-Type: image/jpeg");
echo $img;
Any help is appreciated.

Re: Sepia effect with imagick like in photoshop

Posted: 2014-09-06T10:19:18-07:00
by fmw42
The sepia colorization in PS is much different from IM. You can try changing the color with

1) duotone processing such as http://www.imagemagick.org/Usage/color_mods/#duotone
2) -color-matrix such as http://www.imagemagick.org/Usage/color_ ... lor-matrix
3) convert to grayscale and clut such as http://www.imagemagick.org/Usage/color_mods/#clut
4) convert to graylevel and +level-colors such as http://www.imagemagick.org/Usage/color_ ... vel-colors

But to reproduce PS exactly, the best way is to create a HALD image, take it to PS, apply the PS sepia process, then take the processed HALD image back to IM and use -hald-clut. See http://www.imagemagick.org/Usage/color_mods/#hald-clut

Re: Sepia effect with imagick like in photoshop

Posted: 2014-09-13T15:48:27-07:00
by bseeleib
The HALD image did the trick, @fmw42 thank you very much!!!