Why are there 7 ways to make a black image?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
daviddoria

Why are there 7 ways to make a black image?

Post by daviddoria »

I was reading through some of the examples, and I am confused as to why there are 7 ways to make a solid black image:
http://www.imagemagick.org/Usage/canvas/#other

Maybe I am missing the point of the "canvas"? But what I'm imagining is that you just want a solid background to start working on, so why would you need to use one of those methods over another?

Dave
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Why are there 7 ways to make a black image?

Post by fmw42 »

Anthony was just being thorough and trying to show there are many ways to skin the cat.

If you just want a black background and know the size you need, then just do

convert -size WIDTHxHEIGHT xc:black blackimage.png

(or any other suffix you want)
daviddoria

Re: Why are there 7 ways to make a black image?

Post by daviddoria »

haha ok, thats the one that made the most sense, so I'll just stick with that.

Dave
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Why are there 7 ways to make a black image?

Post by anthony »

Most of the other methods are to take an existing image and turn it into a black canvas that is the same size.

This is only important when writing a IM command so it can handle an image that is ANY SIZE, and not limit the command to a specific sized image.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply