PDA

View Full Version : [ubuntu] Imagemagick



newkid2010
December 1st, 2010, 01:33 PM
Hi guys,

I'm totally new to ubuntu and i'm trying to convert several .png images to .pgm using imagemagick. I have imagemagick installed but it wont read the images i.e. do i have to move the wanted pictures to a particular folder assosciated with image magick, if so what folder is this?

thanks for any help

lykeion
December 1st, 2010, 02:11 PM
Hi and welcome to Ubuntu.

ImageMagick is a library to display, convert, edit images.
It consists of several command-line commands and the one you are looking for is convert.

1. Start a terminal (Applications > Accessories > Terminal)
2. Navigate to where your images are (change path to your actual path)
cd path/to/images
3. Use ImageMagick convert command to convert from PNG to PGM
convert image.png image.pgm
If you have many PNG images you can use a for-loop like this

for i in $(ls *.png); do convert "$i" $(basename $i .png).pgm; done

newkid2010
December 1st, 2010, 03:09 PM
thanks very much works perfectly :)