How to place a image on a white background

MagickWand for PHP is an object-oriented PHP interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning MagickWand for PHP.
Post Reply
Floezen
Posts: 5
Joined: 2013-09-16T11:47:51-07:00
Authentication code: 6789

How to place a image on a white background

Post by Floezen »

I have a picture, lets say 300 x 200 pixel, but I want to have it on a squared "layout" of 400 x 400 pixel. (Without changing the size of the original picture.)

Is there a function to do this? Like an function opposite to MagickCropImage( )?

Or would I have to merge this picture with another white-picture of 400x400?

Thanks
Flözen
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to place a image on a white background

Post by fmw42 »

Find the equivalent of -extent. See http://www.imagemagick.org/Usage/crop/#extent
Floezen
Posts: 5
Joined: 2013-09-16T11:47:51-07:00
Authentication code: 6789

Re: How to place a image on a white background

Post by Floezen »

Ok, thanks so far, but what would be the MagickWand equivalent to extend?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to place a image on a white background

Post by fmw42 »

Floezen wrote:Ok, thanks so far, but what would be the MagickWand equivalent to extend?

Sorry I do not use any APIs, only the command line. The documentation for your API should have something that you recognize with a similar name. Otherwise, someone who uses your API may need to respond.
Post Reply