Image upload placed on shirt

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
ninobo
Posts: 3
Joined: 2016-07-01T01:21:25-07:00
Authentication code: 1151

Image upload placed on shirt

Post 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!
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Image upload placed on shirt

Post 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?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
ninobo
Posts: 3
Joined: 2016-07-01T01:21:25-07:00
Authentication code: 1151

Re: Image upload placed on shirt

Post by ninobo »

thanks for you replay, the result is a little bit better, but not 100% anymore. perhaps has anyone else a idea?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Image upload placed on shirt

Post 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.
Post Reply