It’s pretty easy to do image manipulation with PHP. Here’s a sample of converting an image from color into sepia using PHP’s imagefilter.
Be sure that your memory_limit will handle the image sizes you want to process. @imagecreatefromjpeg will return FALSE if it can’t load the image (because of a bad file path, file size or whatever). This isn’t a real sepia conversion, but it’s a decent fake. The image is converted to greyscale, the brightness turned down, and then colorized with a red tint.
PHP’s imagefilter has lots of other neat tricks it can do, so be sure to check it out.
The original image:

The sepia image:
The image above is generated on the fly, if you’ll check the image source for the image, it is a PHP file. As long as you send the right headers, browsers don’t care what the file extension is, at least for images.
Here’s the code:
<?php
// From http://stuporglue.org/
// Copyright 2008, Michael Moore
// You may use this code for any purpose
function pseudosepia(&$im){
imagefilter($im,IMG_FILTER_GRAYSCALE);
imagefilter($im,IMG_FILTER_BRIGHTNESS,-30);
imagefilter($im,IMG_FILTER_COLORIZE, 90, 55, 30);
}
ini_set('memory_limit', '15M');
$im = @imagecreatefromjpeg('test.jpg');
$percent = '80';
pseudosepia($im);
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-store, no-cache,must-revalidate");
header("Cache-Control: post-check=0, pre-check=0",false);
header("Pragma: no-cache");
header("Content-type: image/jpeg");
imagejpeg($im);
?>
Enjoy!








