Let's say that the images are in the directory /Desktop/projs/proj1/img/
and I want the output files to go to /Desktop/projs/proj1/imgResized/
.
I tried this command:
convert /Desktop/projs/proj1/img/*.png -resize 130x130\! /Desktop/projs/proj1/imgResized/converted.png
This works, but the output images are renamed to converted-0.png
, converted-1.png
, etc.
I tested other commands to see if the images keep their names:
for PHOTO in /Desktop/projs/proj1/img/*.png; do BASE=`basename $PHOTO` convert /Desktop/projs/proj1/img/*.png -resize 130x130 /Desktop/projs/proj1/imgResized/$BASE.png; done;
But it’s not working.
How can I do this? And if possible, how can I do the same but for compressing all the images from folder A to B?
convert "$PHOTO"
. The for variable should be used./Desktop
that directory does not exist except you created else it should have been/home/$USER/Desktop