Hello - I am brand new to working with ImageMagick, and have run into an issue converting .jpg files to .png files while removing the background. I am able to get the process to work perfectly for single images with the following code (line breaks added for readability):
Code: Select all
convert Image.jpg ( +clone -fx p{0,0} ) -compose Difference -composite -modulate 100,0 -alpha off invertedInamge: png:- |
convert -threshold 20% threshold_mask: png:- |
convert Image.jpg -alpha off -compose CopyOpacity -composite Transparent_Image.png
The issue I'm having is turning the code into a batch process. After spending the last couple days searching/reading documentation and other posts, this is as close as I've been able to get:
Code: Select all
convert *.jpg ( +clone -fx p{0,0} ) -compose Difference -composite -modulate 100,0 -alpha off invertedInamge-%d: png:- |
convert -threshold 20% threshold_mask-%d: png:- |
convert *.jpg -alpha off -compose CopyOpacity -composite Transparent_Image-%d.png
The resulting image is a single image - a combination of the alphabetically first image, with a combined mask of all the other images applied to it. What am I doing wrong to where the code is producing a single image instead of multiple results?
I am using ImageMagick 7.0.4-8 through the command line interface on a Windows 7 PC.
Thank you in advance for your help!