Imagick::writeImage


wizard apg

WRITES one image to the specified filename.



<?php

bool 
public Imagick::writeImage(
                                          
string $filename NULL
                                                                                
);

?>

$filename


The filename where to write the image.

The extension of the filename defines the type of the file.

If the filename parameter is NULL, the image is written to the filename set by:
Imagick::readImage

or
Imagick::setImageFilename






This function returns a TRUE on success.



  1 EXERCISE   

<?php

$origname 
PATH2IMGW '/bmp/3.bmp';

$newname PATH2IMGL '/results/3new.bmp';
  
$imagick = new Imagick($origname);

$imagick->setImageFilename('3new.bmp');
$name $imagick->getImageFilename();
echo 
$name;

$imagick->writeImage($newname);

?>

 RESULT   

3new.bmp

img/results/3new.bmp apr

  2 EXERCISE   

<?php

$origname2 
PATH2IMGW '/png/E 01 01.png';

$newname2 PATH2IMGL '/results/E 01 01new.jpg';
  
$imagick = new Imagick($origname2);

$imagick->setImageFilename('E 01 01new.jpg');
$name $imagick->getImageFilename();
echo 
$name;

$imagick->writeImage($newname2);

?>


E 01 01new.jpg

img/results/E 01 01new.jpg apr