0

i create image using Imagick function . i use wood.png as row image , 1.jpg is over right on wood.png . problem is i need to see wood image as transparent of 1.jpg. i also upload result.png but we need same as need.png.

$width =  300;
$height = 400;
$image = new Imagick("wood.png");
$image->cropImage($width,$height, 0,0);
$current_image = new Imagick();
$current_image->readImage('1.jpg');
$current_image->cropImage($current_image->getImageWidth(),$current_image->getImageHeight(), 0, 0);
$current_image->thumbnailImage($width, $height);
$image->compositeImage($current_image, imagick::COMPOSITE_OVER, 0, 0);
header("Content-Type: image/png");
echo $image;

result.png need.pngenter image description hereenter image description here

Pratik Kamani
  • 758
  • 7
  • 23
  • Your question is very hard to understand. I think you want to overlay something onto something else maybe with some transparency. Can you supply two very simple starting images and a result image that shows what you want rather than two images of different sizes please? You do realise you cannot have transparency in a JPEG, don't you? – Mark Setchell Jul 07 '16 at 08:49
  • I added 2 images more . round image will be place on wood image . also first image is my result . and second image is my wishes . – Pratik Kamani Jul 07 '16 at 08:52
  • Does this command in the shell in Terminal give you the correct result? `convert swirl.jpg -resize 343x513! wood.png -compose overlay -composite result.png` – Mark Setchell Jul 07 '16 at 08:59
  • i test this code in php . – Pratik Kamani Jul 07 '16 at 09:57
  • Try using `imagick::COMPOSITE_OVERLAY` in place of `imagick::COMPOSITE_OVER`. – Mark Setchell Jul 07 '16 at 10:02
  • http://madi.metizcloud.com/demo/Createimage.png i already do this . but image will be disturb. see above url . If you need to code then tell me I give you FTP . All is ready here. – Pratik Kamani Jul 08 '16 at 09:45

0 Answers0