Right now i have this working code, to add a transparant image called "mask.png" to a "test.jpg" file:
convert -quality 70 -draw 'image Over 0,0 1024,768 "mask.png"' "test.jpg" jpg:"e4408a4e.jpg"
This command takes about 2 seconds to complete, and i think there must be a quicker way.
All i want to do, is "overlay" the mask onto the input picture. I've had faster results with using this command:
composite -compose plus "mask.png" "test.jpg" jpg:"e4408a4e.jpg"
But i also need to resize the input file, so i thought i'd do it in one call to convert.
Allready found the answer thanx to this page: http://www.imagemagick.org/Usage/thumbnails/
convert "test.jpg" -quality 70 "mask.png" -compose Over -composite jpg:"e4408a4e.jpg"
The best way to add a PNG mask using convert?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: The best way to add a PNG mask using convert?
Good to see you using IM Examples.
You can however also resize and position the image in composite (and convert) using the -geometry operator. See
http://www.imagemagick.org/Usage/resize/#geometry
You can however also resize and position the image in composite (and convert) using the -geometry operator. See
http://www.imagemagick.org/Usage/resize/#geometry
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/