I'd like to render a single file say 1.jpg to multiple Read/Write formats ImageMagick supports for eg. 1.png, 1.tif, 1.pdf etc. on a Windows machine. Is there a quick command to do that or do I have to run convert each time to render 1.jpg to each new output format I want?
2 Answers
Like this:
convert 1.jpg \
\( +clone -write 1.gif +delete \) \
\( +clone -write 1.png +delete \) \
1.tif
6 Comments
Regmi
Thanks it works! Minor irritation is it creates two copies of gif and png files, any ideas on fixing that?
Mark Setchell
Oh, that's weird. Mine does not do that - I use version 6.8.9. Maybe try and upgrade if you are running an older version.
Regmi
Mine is 6.8.9-0 and am running it on Win 7 x64.
Kurt Pfeifle
@MarkSetchell: If you use
+write instead of -write then you can save yourself the +delete...Mark Setchell
@KurtPfeifle Cool - why do you have
\( and \) around your writes by the way? You could equally do convert ... +write a.gif +write a.tif +write a.png a.pnm |
To make it create only one copy of GIF, PNG and other written files, use this command (asumuing, you want to convert myinputfile.jpg):
name=myinputfile
convert \
${name}.jpg \
-resize 50% \
\( +write ${name}.png \) \
\( +write ${name}.ppm \) \
\( +write ${name}.tif \) \
\( +write ${name}.gif \) \
\( +write ${name}.pdf \) \
${name}.pnm