Batch Resize: Difference between revisions

From Open Source Ecology
Jump to navigation Jump to search
(Created page with "All it takes is one line to resize a directory full of images to your desired size if you have the ImageMagick tools package installed. convert is a tool that comes with that ...")
 
No edit summary
Line 4: Line 4:


nits@excalibur:$ sudo apt-get install imagemagick
nits@excalibur:$ sudo apt-get install imagemagick
To only resize:
 
To resize only:


nits@excalibur:$ find . -iname '*.jpg' -exec convert {} -resize 640x480 {} \;
nits@excalibur:$ find . -iname '*.jpg' -exec convert {} -resize 640x480 {} \;
To resize and convert to another format (example converts JPEG to PNG):
To resize and convert to another format (example converts JPEG to PNG):


nits@excalibur:$ find . -iname '*.jpg' -exec convert {} -resize 640x480 {}.png \;
nits@excalibur:$ find . -iname '*.jpg' -exec convert {} -resize 640x480 {}.png \;
Oh yeah! That’s all!
Here’s the YouTube video if you want to see it in action. Also, you get to see me make a fool of myself by making nervous typos :P

Revision as of 16:32, 4 September 2014

All it takes is one line to resize a directory full of images to your desired size if you have the ImageMagick tools package installed. convert is a tool that comes with that package.

To install ImageMagick: (on Debian/Ubuntu based systems)

nits@excalibur:$ sudo apt-get install imagemagick

To resize only:

nits@excalibur:$ find . -iname '*.jpg' -exec convert {} -resize 640x480 {} \;

To resize and convert to another format (example converts JPEG to PNG):

nits@excalibur:$ find . -iname '*.jpg' -exec convert {} -resize 640x480 {}.png \;