width | int | The new width |
height | int | The new height |
x | int | X position for the new size |
y | int | Y position for the new size |
function extentImage($imagePath) { $imagick = new \Imagick(realpath($imagePath)); $imagick->setImageBackgroundColor('orange'); $imagick->extentImage( $imagick->getImageWidth(), $imagick->getImageHeight(), -100, -100 ); header("Content-Type: image/jpg"); echo $imagick->getImageBlob(); }