I have multiple images stored in a set of organized folders. I need to re-size those images to a specific percentage recursively from their parent directory. I am running Ubuntu 11.10 and i prefer learning how to do that directly from the terminal.
If you are using Fedora, Arch, or other non-Debian Linux, you can use your distribution's package installing command. Now if you right click on an image, you'll see two new options of resizing and rotating in the context menu. You can choose the resize option to resize the image right from the right-click menu quickly.
Select a group of images with your mouse, then right-click them. In the menu that pops up, select “Resize pictures.” An Image Resizer window will open. Choose the image size that you want from the list (or enter a custom size), select the options that you want, and then click “Resize.”
You could use imagemagick. For instance, for resizing all the JPG images under the current directory to 50% of their original size, you could do:
for f in `find . -name "*.jpg"` do convert $f -resize 50% $f.resized.jpg done
The resulting files will have ".jpg" twice in their names. If that is an issue, you can check the following alternatives.
For traversing/finding the files to resize, you can use xargs too. Example:
find . -name "*.jpg" | xargs convert -resize 50%
This will create copies of the images. If you just want to convert them in place, you can use:
find . -name "*.jpg" | xargs mogrify -resize 50%
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With