[kanchilug] [Tip] Convert all images to grayscale With One Command

  • From: "Tha.Suresh" <jemenisuresh@xxxxxxxxx>
  • To: ILUG-C <ilugc@xxxxxxxxxxxxx>, KanchiLug <kanchilug@xxxxxxxxxxxxx>, Linux Delhi <iitdlug@xxxxxxxxxxxxxxxx>, Mlug <glug-meerut@xxxxxxxxxxxxxxxx>, puduvailug@xxxxxxxxxxxxx, ilug-bengaluru@xxxxxxxxxxxxxxxx
  • Date: Thu, 24 Mar 2011 16:19:23 +0530

We can use "convert" or "mogrify" to make this transition from color to
grayscale.

Use "convert" to make a color image to a grayscale one:

     $ convert -type Grayscale input.png output.png

This will keep your original picture “input.png” in color, and create a new
one in grayscale “output.png”

Use "mogrify" to convert an image to grayscale:

     $ mogrify -type Grayscale input.png

This will change your original picture “input.png”

When we need  to convert bulk pictures to grayscale, no need to run a bash
for loop, or a script.

simply copy all files to a new folder, and then run the "mogrify" command
there. Like this:
     $ cp /home/user/my_pics/*  /home/user/my_pics_grayscale/

Then run "mogrify" on the second folder.

     $ mogrify -type Grayscale /home/user/my_pics_grayscale/*


-- 
Regards,
Tha.Suresh

My experiences with Linux are here,
http://thasulinux.wordpress.com

Other related posts:

  • » [kanchilug] [Tip] Convert all images to grayscale With One Command - Tha.Suresh