I want to scale all images in a given folder to the same width (but different appropriately scaled heights). How can I do this using a GUI-based or command-line tool?
For bonus points, is it possible to restrict which images are scaled based on their initial width (that is, only scale images that have a width > x and/or a width < y)?
This is very easy to do with imagemagick. You should be able to install it in the Software Center. I would suggest it for batch processing of images.
The batch resizing is incredibly simple (I tested it with Ubuntu 11.10). Use the following command to resize every .jpg file to 200 pixel width, keeping the aspect ratio:
you can maintain the filename by using -set option. Ex:
If you have more files you should use with find
This is only scratching the surface of the power of imagemagick. Resizing can be tuned endlessly. For more advanced resizing you have to use the
-resize
option.You can limit the resizing to shrinking:
or enlarging:
Have look at the geometry documentation to see more options.
For GUI, Phatch "one click is worth thousand photos" is the best for such quick job. It is already in Ubuntu repository.
Try this:
Then, open up Gimp and open the Batch plugin found in
Filters > Batch > Batch Process
.Select your images in the
Input
tab, and define the Resize operation in the surprisingly-namedResize
tab.More information can be found here.
Try
mogrify
command from ImageMagick tools.Example:
Answered and accepted (and I use ImageMagick) but for completeness... I have a non-technical boss that wanted a simple viewer with some basic tools and it had to be GUI. I decided on gThumb for him.
In the thumbnail view you...
Here is how I did it by shrinking only larger images:
It will appropriately scaled the heights.
To use the
convert
command, you need to install Imagemagick viasudo apt-get install imagemagick
.For Windows, see: A Batch Script To Resize Images.
For batch image resizing I’ve looked at many packages and finally found one with a usable interface – converseen. Once you discover that the important settings are somewhat hidden on the scrollable left pane, all is well.
Not sure if this meets all of the OPs use cases, but you may not have to look at the quirky UIs of imagemagick or phatch.
Oddly, photo management packages like digikam, f-spot, fotoxx or shotwell don't seem to recognize the need for copying/resizing batches of images before uploading to online services like photobucket or (gag) flickr. These services want us to do things their way only so I do not trust them for backing up originals.