1

I've installed ImageMagick v7.0.10-26 on to Windows and I'm running it from a cmd line. I've not installed convert.

This example creates two new image files, modified as specified, from the existingimage.png:

magick existingimage.png -gravity south -fill white -pointsize 150 -annotate +0+20 "Hello World" -write newimage1.gif newimage2.gif

When I remove newimage2.gif from the command, then magick complains (and output no images) with:

magick: MissingArgument `-write' at CLI arg 11 @ fatal/magick-cli.c/ProcessCommandOptions/447.

Why does -write require two parameters?

1 Answer 1

0

Why does -write require two parameters?

It doesn't. It requires one parameter, an "intermediate" output file name.

You appear to be misunderstanding the "final" (fully processed) output file name (e.g. newimage2.gif) as being part of -write, which it is not. Any final output file name is typically the last parameter for magick ...:

# Create both an "intermediate" image processed with the 
# options up to "-write filename" ("newimage1.gif") and 
# a separate "final" image ("newimage2.gif") with those 
# same options.

magick existingimage.png -gravity south -fill white -pointsize 150 -annotate +0+20 "Hello World" -write newimage1.gif newimage2.gif

# Create just a "final" image, processed with all the 
# existing options in the given "magick" command.
# (no "-write filename" command needed)

magick existingimage.png -gravity south -fill white -pointsize 150 -annotate +0+20 "Hello World" newimage2.gif

# Create both an "intermediate" image processed with the 
# options up to "-write filename" ("newimage1.gif") and 
# a separate "final" image ("newimage2.gif") with additional 
# options unique to it ("-resize 50%"). 

magick existingimage.png -gravity south -fill white -pointsize 150 -annotate +0+20 "Hello World" -write newimage1.gif -resize 50% newimage2.gif

# This produces an error. The "final" file name here for 
# "magick ..." is "newimage1.gif" and "-write" has no 
# "intermediate" file name specified.

magick existingimage.png -gravity south -fill white -pointsize 150 -annotate +0+20 "Hello World" -write newimage1.gif
1
  • I don't understand why this was downvoted. This is the right answer.
    – greatvovan
    Sep 11, 2023 at 3:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .