I would like to convert some .jpgs to a 640x480 size.
I looked through my Ubuntu_Tips.odt file and found this.
Convert png to a 640x480 png.
convert Screenshot_1360x768.png -resize 640x480! 640smaller.png
I have 8 of those files in /home/andy/Downloads/.
Is there a way to do a batch convert of those .jpgs files to the smaller file size?
Thanks.
Repeat your command 8 times? It is probably the better method as you might need to change your command on the current proportions of those files. A command that repeats
convert
without taking that in consideration will not get the expected result.Instead of convert there is also
mogrify
. It does not require a 2nd filename so this will convert all pngs to 640x480. You can narrow it down by altering the wildcard:(this will overwrite the existing file(s))
If you need to alter proportions you need to add an escaped !:
(this will result in a new file)