1

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 2

4

Like this:

convert 1.jpg \
        \( +clone -write 1.gif +delete \) \
        \( +clone -write 1.png +delete \) \
        1.tif
Sign up to request clarification or add additional context in comments.

6 Comments

Thanks it works! Minor irritation is it creates two copies of gif and png files, any ideas on fixing that?
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.
Mine is 6.8.9-0 and am running it on Win 7 x64.
@MarkSetchell: If you use +write instead of -write then you can save yourself the +delete...
@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
|
1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.