I can upgrade (no isp) but I'd need to upgrade the whole OS to the newest Fedora and I don't have the time for that unfortunately, maybe later in the month.
I am using imagick, the commands are quite involved as it is taking an array of tiles/images and converting them (the whole thing is inside a Drupal module as well).
Here are the relevant bits
Code: Select all
$image = new Imagick();
$image->setResolution(300, 300);
$image->newImage(1181, 1181,
new ImagickPixel('none')); //new image w/ transparency
//make it a pdf
$image->setImageFormat('pdf');
$image->setImageColorspace(imagick::COLORSPACE_RGB);
$image->setCompression(imagick::COMPRESSION_ZIP);
$image->setCompressionQuality(80);
//adding the rectangle
$background = new ImagickPixel('#00ff00'); //green for example
$tile_img = new Imagick();
$tile_img->newImage(500,
500,
$background);
//combine the tile into the image (this is done lots of times)
$image->compositeImage($tile_img,
Imagick::COMPOSITE_DEFAULT,
10,
10);
//output the image
header("Content-type: application/pdf");
echo $image->getImageBlob();
If I change the two refs to pdf to png (eg the header and the setImageFormat) I get the correct green, with pdf, the colour is washed. -
here is the png version
Code: Select all
$image = new Imagick();
$image->setResolution(300, 300);
$image->newImage(1181, 1181,
new ImagickPixel('none')); //new image w/ transparency
//make it a pdf
$image->setImageFormat('png');
$image->setImageColorspace(imagick::COLORSPACE_RGB);
$image->setCompression(imagick::COMPRESSION_ZIP);
$image->setCompressionQuality(80);
//adding the rectangle
$background = new ImagickPixel('#00ff00'); //green for example
$tile_img = new Imagick();
$tile_img->newImage(500,
500,
$background);
//combine the tile into the image (this is done lots of times)
$image->compositeImage($tile_img,
Imagick::COMPOSITE_DEFAULT,
10,
10);
//output the image
header("Content-type: image/png");
echo $image->getImageBlob();
This is an edited bit of my code but demonstrates the basics for this issue and should run on your machine (can't see any dependencies on my code!)