I'm new to imagemagic aka imagick on php and im trying to follow this thread using php code. I have tried to apply this logo onto a tshirt but couldn't do so by following the threas becuase i cannot find most of the methods in php like using displacement map to start with. What i have tried is the following code:
$image = new Imagick($_SERVER['DOCUMENT_ROOT'] . '/images/VYLZsoD.jpg');
$logo = new Imagick($_SERVER['DOCUMENT_ROOT'] . '/images/logo.png');
$logo->resizeImage(200, 200, imagick::FILTER_LANCZOS, 1, TRUE);
header("Content-Type: image/jpg");
$image->compositeimage($logo, Imagick::COMPOSITE_DEFAULT, 400, 260);
$image->flattenImages();
echo $image;
I would want to use the steps shown in the thread to create a mask and so on in order to apply the logo onto the tshirt using php code (not via command). I have even used "COMPOSITE_OVERLAY" to make the logo look like its part of the tshirt but it seems like the original color of the logo reduces because of the transparency, check here for my final tshirt http://i62.tinypic.com/2ahuw6h.png.
- Please tell me how i can archive a better result using imagick in php (without the color of the logo is being reduced)
- Can i mark a territory on the tshirt so that when i drag the logo around, it wouldn't show outside the tshirt border?
Source tshirt http://i58.tinypic.com/154j52b.jpg Source logo http://i59.tinypic.com/e02051.png