Image format

Soldato
Joined
22 Oct 2005
Posts
2,884
Location
Moving...
I've got a couple of hundred images that I need to convert from a .png format to a .ppm format. I've had a look but I cant find any converters that are any good, they either dont work, or have silly limitations like maximum file size or only can do one file at a time. At the minute I've done it by opening the .png ing photoshop and then saving it as a .ppm but as you can imagine this is pretty time consuming. Anyone know of any decent converters or ways to speed up my current method?

Also, it has to be .ppm not .pbm / .pgm.

Thanks for any advice.
 
imagemagick is your friend.

Get the Q8 dll version.
then write a small script.

something like (copy and past into a temp.bat file)

Code:
if not exist c:\out mkdir c:\out
for /f "delims=" %%a in ('dir %1 /b /a-d') do
    convert "%1\%%a" "c:\out\%%a.ppm"
)
pause

drag and drop the folder of images onto this file and it should create your output.
 
Last edited:
Thanks whitecrook. I made the .bat file and dragged the folder onto it. It made the c:/out folder but it is empty. What does that .bat file do? I have never seen code like that before.

Thanks again.
 
Thanks whitecrook. I made the .bat file and dragged the folder onto it. It made the c:/out folder but it is empty. What does that .bat file do? I have never seen code like that before.

Thanks again.


Whoops bracket at end of the for line " ( " should read:

Code:
 for /f "delims=" %%a in ('dir %1 /b /a-d') do [B]([/B]

Ifranview is great, too - forgot about that..
 
No worries, I made a quick Java file to generate the individual calls then put them all in a bat file so it's all done now. But thanks for the advice anyway.

Just for my info really but does that language have a name you used whitecrook or is it just common windows language?
 
Oh hi never noticed the reply.

Good for you did you use the imagemagick JAVA library?

That bit of code is just WinXP batch scripting. Like DOS scripts but a bit more functional.

more info at ss64.com
 
Irfanview as mentioned above has a batch coversion feature which handles both .png and .ppm amongst a silly amount of other formats. No brainer really :/
 
Back
Top Bottom