If I convert my images with
convert -quality 80% *.jpg
It works, but the software changes the file names to the first one it picks. How can I keep the name or even replace the previous image with that of a lower quality.
If I convert my images with
convert -quality 80% *.jpg
It works, but the software changes the file names to the first one it picks. How can I keep the name or even replace the previous image with that of a lower quality.
convert command help:
convert input-file [options] output-file
Now a little script to convert all jpg files to 80% quality of original under current directory
for file in *.jpg; do
convert "$file" -quality 80% "$file"
done;
ls
, as it can be shortened to for f in *jpg
. And mogrify can work on multiple files at once.
Commented
Mar 29, 2012 at 17:02
This will work for you.
convert -quality 80% '*.jpg' -set filename:original %t %[filename:original].jpg