SunshinePHP 2016


(PECL imagick 2.0.0)

Imagick::setImageCompressionConfigure la compression de l'image


bool Imagick::setImageCompression ( int $compression )

Configure la compression de l'image.

Liste de paramètres


Une des constantes COMPRESSION.

Valeurs de retour

Retourne TRUE en cas de succès.

Erreurs / Exceptions

Lance une exception ImagickException si une erreur survient.

add a note add a note

User Contributed Notes 1 note

snipes2083 [at] yahoo com
5 years ago
Above it says "One of the COMPRESSION constants" for the parameters.  For any of you that found this confusing, you can find a list of the constants here:

Predefined Constants

As an example for working with a jpeg image:

= 'jpeg_image.jpg';
$comression_type = Imagick::COMPRESSION_JPEG;
$im = new Imagick($image);

This class does not actually compress the images but rather sets the compression type that is going to be used. 

If you would like to see how to compress the image see:
To Top