I have a folder of images over 4MB – let’s call this folder dsc_big/. I’d like to use convert -define jpeg:extent=2MB to convert them to under 2MB and copy dsc_big/* to a folder dsc_small/ that already exists.
I tried convert dsc_big/* -define jpeg:extent=2MB dsc_small/ but that produces images called -0, -1, and so on.
What do I do?
convertis designed to handle a single input file as far as I can tell, although I have to admit I don’t understand the output you’re getting. mogrify is better suited for batch processing in the following style:But honestly I consider it dangerous for general usage (it’ll overwrite the original images if you forget that
-path) so I always useconvertcoupled with a for loop for this:The
basenamecall isn’t necessary if you’re processing files in the current directory.