How to create a new image?
How to create a new image?
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?
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?
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);
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?
Sorry my fault it should just be xc:white NOT -xc:white
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: How to create a new image?
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.
Oh and look though the IM Examples Web page.. Canvas Generation as a whole area just to itself.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: How to create a new image?
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");