Create a blank image in Imagemagick

How to create a blank new image in Imagemagick through the command line?

Usage -backgrounddoes not work:

$ convert -size 800x800 -background white x.png
convert: no images defined `x.png' @ error/convert.c/ConvertImageCommand/3257.
+4
source share
1 answer

White background

convert -size 800x800 xc:white white.png

xc:meant "X Constant Image", but now it's just a shorthand for canvas:. This means that you can also use:

convert -size 800x800 canvas:white white.png

and because "white" is the default, if no color is specified, you can also use:

convert -size 800x800 xc: white.png
convert -size 800x800 canvas: white.png

Transparent background

If "blank" means "transparent," simply use this word as a color:

convert -size 800x800 xc:transparent transparent.png

Answer made by ImageMagick v6 Examples and How to create a new image?

+12
source

Source: https://habr.com/ru/post/1654660/


All Articles