Sun
20
Mar '11
|
by Frank Spychalski filed under Braindump
|
I just spent a few minutes looking for a tool to convert a small number of PNG files to JPG on Mac OS. It was just a few dozen files but so in the end fell back to the good old command line because I don’t like graphical interfaces for these tasks.
For future reference:
for file in *.png; do jpg="$(basename \"$file\" .png).jpg"; convert "$file" "$jpg"; done
Yes, it’s that simple once you have installed ImageMagick.
wow! Mac users can still use the command line! I’m impressed
Instead of ImageMagick you could you use sips (scriptable image processing system). This is installed by default on Mac OS.
for ex. sips -s format jpeg “$file” –out “$jpg”
Thanks I have to try this.
Additionally Mike suggested on FB:
for file in *.png; do convert "$file" "${file%.png}.jpg"; done