Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 stackoverflow.com Jun 9 '11 at 9:52

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

4 Answers 4

up vote 11 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. imagemagick.org/script/command-line-options.php?#density –  colemik Mar 18 '12 at 3:46

ImageMagick's convert can do this.

share|improve this answer

Here you go:

http://www.imagemagick.org/Usage/canvas/

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.