Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for an xpm icon to use as a placeholder until I make something better.

Are there any linux command line tools that create blank images of specified dimensions? Like people use touch to create blank text files.

share|improve this question

migrated from Jun 9 '11 at 9:52

This question came from our site for professional and enthusiast programmers.

up vote 16 down vote accepted

The convert command from ImageMagick can be used:

To create a 32x32 image with a white background:

convert -size 32x32 xc:white empty.jpg

To create a 32x32 image with a transparent background:

convert -size 32x32 xc:transparent empty2.jpg
share|improve this answer
To specify the DPI setting, use the -density 96 switch. – colemik Mar 18 '12 at 3:46

ImageMagick's convert can do this.

share|improve this answer

Here you go:

Imagemagick does it all for you. You can specify size, colour and filetype. Also you can put it through 'passthru' or 'exec' in your code or run the php module version.

share|improve this answer

You can use convert -size 123x456 xc:white x.png. convert is part of ImageMagick.

share|improve this answer

You must log in to answer this question.

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