Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Mogrify works on directories and as far as I know does not work from a text file list of images.
Convert will work with a text file as input. The output image could be some multiframe format or separate images.
This work:
convert logo.png zelda3.png lena.png -gravity center -crop 100x100+0+0 +repage tmp.tiff (gives a multiframe image)
or
convert logo.png zelda3.png lena.png -gravity center -crop 100x100+0+0 +repage tmp_%d.png (gives multiple images)
And if I put all 3 image names in a text file, then this works.
convert @tmp.txt -gravity center -crop 100x100+0+0 +repage tmp2_%d.png
Also you could write a script that will read the images from the text file and loop over a convert to crop the image and write an appropriate output for each image.
Well this used to work. As I understood it, mogrify modifies an image (i.e. crop me.jpg) whereas convert requires both an input and output image file (i.e. convert me.jpg to me.png). Is it possible to do this with convert without generating another image file which I would have to find and remove?
Because the images I need to crop are in arbitrary locations I used the text file with image paths to achieve batch job processing. If I swap the arguments around to:
mogrify @picsToConvert.txt -crop 300x300+0+0 -gravity Center
This works and I can see that mogrify is touching each image and the Gnome folder thumbnail refreshes but it does not crop anything. Its as if the commands need to preceed the files.
ross@ross-encoder:/media/media/240subset/test$ mogrify -crop 30x30+0+0 @pics.txt -gravity Center
mogrify: invalid argument for option `magick': -crop @ error/mogrify.c/MogrifyImageCommand/4546.
ross@ross-encoder:/media/media/240subset/test$
ross@ross-encoder:/media/media/240subset/test$
ross@ross-encoder:/media/media/240subset/test$ mogrify -crop @pics.txt 30x30+0+0 -gravity Center
mogrify: unable to open image `30x30+0+0': @ error/blob.c/OpenBlob/2498.
mogrify: no decode delegate for this image format `30x30+0+0' @ error/constitute.c/ReadImage/532.
parallel is a xargs equivelent that will use multiple cores to process files in parellel though as IM is already multi-threaded that may not always be a good thing.