I have to resize images, cause we upload printable high res images and for the preview people dont need a 4000px+ image. Some images using the rgb color space "eci" and others using the color space srgb. The srgb files dont have any problems, but the eci looking a bit colourless than before. And when I upload a transparent image, its not perfect transparent. Is there any solution? When I resize and its a png image, I use following extra function.
private function imagetranstowhite($trans) {
// Create a new true color image with the same size
$w = imagesx($trans);
$h = imagesy($trans);
$white = imagecreatetruecolor($w, $h);
// Fill the new image with white background
$bg = imagecolorallocate($white, 255, 255, 255);
imagefill($white, 0, 0, $bg);
// Copy original transparent image onto the new image
imagecopy($white, $trans, 0, 0, 0, 0, $w, $h);
return $white;
}
Does anyone have a solution? Imagemagick instead of gdlib is fine too.