How to resize multiple image with single command

I tend to be lazy .. hehehehe..

sometime I took a lot of picture then later don’t know how to select and post ..
some more need to resize each one of them before publish or send out to somebody else..

figured out.. by creating a simple bash script file with following content :


for i in `ls  *.JPG`
convert -verbose -resize 50% -comment "(c) HawkEYE Expression's" $i resized_${i%%.*}.jpg

* Updated to fix the filename extension to lower-cased..

Then have make it executable .. before can use .. by issuing this command.

chmod a+x  ~/bin/

to use it..

cd ~/where/to/image_folder/
~/bin/ .

it will take every single JPG file in the folder and resized it by 50% .. and renamed to resized_original_name.jpg
quite handy when to handle let’s say 300+ images…

p/s : can remove verbose string if don’t want to know the progress of the conversion process..
btw .. dependencies is :

[root@nb-namran ~]# rpm -q --whatprovides /usr/bin/convert

Get Free Email Updates!

Signup now and receive an email once I publish new content.

I will never give away, trade or sell your email address. You can unsubscribe at any time.


Related Post

2 Responses

  1. desa ku pilar says:

    Hello there, I believe your web site may be having browser compatibility issues.
    When I take a look at your blog in Safari, it looks
    fine but when opening in Internet Explorer, it has some overlapping issues.
    I merely wanted to provide you with a quick heads up! Aside from that,
    great blog!

  2. pub quiz austin texas says:

    DJ spins out on Saturday nights. At the end of each round
    read out the cumulative scores. Theme Format: It is almost like standard format of the pub quiz.


Anything to add?