LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Is there a terminal command to change the size of a group of images? (https://www.linuxquestions.org/questions/linux-newbie-8/is-there-a-terminal-command-to-change-the-size-of-a-group-of-images-681852/)

swalker23 11-07-2008 03:55 PM

Is there a terminal command to change the size of a group of images?
 
I have a folder with some .png icons in it and they are all 128x128 and I want to change to a smaller size. Instead of tediously changing each image one by one in gimp I was wondering is there a command I can use in terminal to change all the images to a certain size.

i92guboj 11-07-2008 04:05 PM

Quote:

Originally Posted by swalker23 (Post 3334837)
I have a folder with some .png icons in it and they are all 128x128 and I want to change to a smaller size. Instead of tediously changing each image one by one in gimp I was wondering is there a command I can use in terminal to change all the images to a certain size.

You can use a loop. If you are into the given directory, you could do this:

Code:

for file in *.png; do echo convert -resize 96x96 "$file" "${file/.png/_96x96}.png"; done
If you like the output, then remove "echo" to actually do the job.

pwc101 11-07-2008 04:06 PM

There's imagemagick or David's Batch Processor for the GIMP, which I can resize a series of files (http://members.ozemail.com.au/~hodsond/dbp.html). David's Batch Processor is a doddle to install: get the source, untar, cd into its directory, and then type make install (installs to ~/.gimp*/plugins).

Google should have answers on how to use imagemagick for resizing a series of files, for example: http://www.imagemagick.org/Usage/resize/#resize

swalker23 11-07-2008 04:19 PM

Thanks you guys. David Batch Processor looks like exactly what I need. It seems simple and easy to use. I will read more into imagemagick but it seems like I will be going with DBP.


All times are GMT -5. The time now is 04:31 PM.