Page 1 of 1

Image upload placed on shirt

Posted: 2016-07-02T02:21:36-07:00
by ninobo
we try on our website to uplaod a custom image and place this on a shirt. but the quality of the uploaded image is still not 100% good quality. here you find a snippet of our code

$im = new Imagick();

if ($file_format == 'eps') {
$im->setColorspace(Imagick::COLORSPACE_RGB);
}
$im->setResolution(150, 150);
$im->readImage($input_file);
$im->setImageUnits(Imagick::RESOLUTION_PIXELSPERINCH);
//$im->setImageResolution(150, 150);
$im->resizeImage(400, 400, imagick::FILTER_LANCZOS, 1, true);
$im->setImageFormat($output_format);

this is our result here (bad) http://www.shirtee.de/media/bad-result.png
here is the good result from other company site http://www.shirtee.de/media/good-result.png
here you find the original file http://www.shirtee.de/media/sailing.png

any idea? thanks!

Re: Image upload placed on shirt

Posted: 2016-07-02T03:09:03-07:00
by dlemstra
I am not an IMagick expert so I don't know what $blur does in '$im->resizeImage(400, 400, imagick::FILTER_LANCZOS, 1, true)' but you might want to lower the '1' value. What happens when you use '0.5' or '0.0' instead?

Re: Image upload placed on shirt

Posted: 2016-07-03T04:09:11-07:00
by ninobo
thanks for you replay, the result is a little bit better, but not 100% anymore. perhaps has anyone else a idea?

Re: Image upload placed on shirt

Posted: 2016-07-03T10:51:17-07:00
by fmw42
Your input is a vector format (EPS). So you probably need to set the density to some large value (say 288=72*4) before reading the input image. Then resize by 25% after reading the input image (or to the default size as determined by 72 dpi).

According to the Imagick manual, blur=1 is no blur. Blur>1 is blurring. Blur<1 is sharpening. So use blur=1 to start.