LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   converting .bmp to .jpeg (https://www.linuxquestions.org/questions/programming-9/converting-bmp-to-jpeg-47875/)

wincrk 03-02-2003 07:36 AM

converting .bmp to .jpeg
 
hi, i had heard before that there is an easier way to convert a large number of .bmp picture into .jpg picture . i heard that it is a script. did some one know or own such script that able to do so?
or do someone know where i could get it?... because i am tired to convert it one by one.

Q*Bert 03-02-2003 08:02 AM

Have a look at the program called 'convert':

man convert

I'm not familiar with it, but it does what you want I think. I think it's part of the ImageMagick set of tools.

Q*Bert

jbarratt 03-03-2003 02:49 PM

Quick bash mini-script to do bulk conversion
 
I use 'convert' with a simple bash for loop quite a bit to do various tasks.

Code:

for i in *.jpg ;
do
    convert $i `basename .jpg $i`.gif
done

You can also use this trick to, for example, make thumbnails

Code:

for i in *.jpg ;
do
  convert -size 640x480 $i `basename .jpg $i`-small.jpg
done


JStew 03-03-2003 05:05 PM

the Gimp will do it too...

jbarratt 03-03-2003 05:56 PM

Really? Bulk conversion? How does that work?

wincrk 03-04-2003 08:21 PM

thanks everyone. actually i am not so good in programming because i used to do everything in windows. i am new to linux.

let say if i have several number (more than 100) of .bmp file and i want to convert it to .jpeg and those .jpeg file will be named like .bmp name. for example if the .bmp name is picme.bmp, then after the conversion, the name is picme.jpeg.
could somebody give me the script to do that?


All times are GMT -5. The time now is 04:10 AM.