Well.
I've post a message few days oge, but finally it doen't really explain what I need.
I have a jpeg image like this
http://www.webshaker.net/imagemagick/src.jpg
I have a gif mask image
http://www.webshaker.net/imagemagick/black-mask.gif
or this one
http://www.webshaker.net/imagemagick/white-mask.gif
I dont' know which one i usefull
and I want a gif transparent destination image like this
http://www.webshaker.net/imagemagick/result.gif
And I do not succed to combine this image to obtain the right result !!!
Can somebody help me please ?
Thank's
Etienne
The return of masking image
Re: The return of masking image
Its strange but as I try to save your images the only option I get is bmp not jpg or gif as the file extension in the link.
This is done using php but you should be able to modify it to what you want:
This is done using php but you should be able to modify it to what you want:
Code: Select all
<?php
exec("convert -size 100x100 xc:none -fill black -draw \"circle 50,50 50,1\" mask.png");
exec("composite -compose Dst_In mask.png -gravity center untitled.bmp -matte result_dst_In1.png");
?>
<img src="mask.png">
<img src="result_dst_In1.png">
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
Re: The return of masking image
This will produce the result using the command line:
A couple of questions/problems for the Wizards.
If I change the output of the above command to result.png the png file does not have the matte layer, even if I add -matte before -compose or after -composite. However if I just do "convert result.gif result.png" the png is correct.
If I change the command even further so that it gets the original images from the net:
it fails with the message
no encode delegate for this image format 'result.png'
I'm using IM6.3.5-4 Q8 on WinXP Pro.
Pete
Code: Select all
convert src.jpg ( black-mask.gif +matte -negate ) -compose CopyOpacity -composite result.gif
If I change the output of the above command to result.png the png file does not have the matte layer, even if I add -matte before -compose or after -composite. However if I just do "convert result.gif result.png" the png is correct.
If I change the command even further so that it gets the original images from the net:
Code: Select all
convert http://www.webshaker.net/imagemagick/src.jpg ( http://www.webshaker.net/imagemagick/black-mask.gif +matte -negate ) -compose copyopacity -composite result.png
no encode delegate for this image format 'result.png'
I'm using IM6.3.5-4 Q8 on WinXP Pro.
Pete
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: The return of masking image
Due to the nature of "-compose copyopacity -composite" the resulting image should always have a matte channel (not layer) regardless of what the input images has. however the overlay image should NOT have a matte channel if it is a greyscale mask, If it does have a matte channel, it is the matte channel that is copied (as implied by the compose) rather than the greyscale values.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/