Page 1 of 1

How to create a new image?

Posted: 2008-07-24T03:00:38-07:00
by derMatze
I'm sorry, cause that may sound a little stupid, but: How can I just create a new blank image, using IM through php and the exec()-function?

Re: How to create a new image?

Posted: 2008-07-24T07:53:51-07:00
by Bonzo
Image 100 x 100 with a white background:

Code: Select all

exec("convert -size 100x100 -xc:white canvas.jpg");

Re: How to create a new image?

Posted: 2008-07-24T08:09:38-07:00
by derMatze
Nothin happended after doing that.
Even the $returnarray is empty and $returnvalue is 1 in
exec("convert -size 100x100 -xc:white canvas.jpg", $returnarray, $returnvalue);

Re: How to create a new image?

Posted: 2008-07-24T08:15:02-07:00
by Bonzo
Sorry my fault it should just be xc:white NOT -xc:white

Re: How to create a new image?

Posted: 2008-07-24T08:22:59-07:00
by derMatze
yes, thanks! :)

Re: How to create a new image?

Posted: 2008-07-24T20:47:33-07:00
by anthony
I suggest you get a command line version of IM, and play with that to get the results right. Then you can plug the command into PHP.

Oh and look though the IM Examples Web page.. Canvas Generation as a whole area just to itself.

Re: How to create a new image?

Posted: 2013-06-19T13:18:08-07:00
by Bonzo
Updated code as requested to create an Image 100px x 100px with a white background:

Code: Select all

exec("convert -size 100x100 xc:white canvas.jpg");