CakeFest 2017 NYC, the Official CakePHP Conference


(PECL imagick 2.0.0)

Imagick::profileImageAjoute ou retire un profil d'une image


bool Imagick::profileImage ( string $name , string $profile )

Ajoute ou retire un profil ICC, IPTC ou générique d'une image. Si le profil est NULL il est retiré de l'image, et sinon, ajouté. Utilisez le nom de '*' et un profil NULL pour retirer tous les profils d'une image.

Liste de paramètres



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 3 notes

Eero Niemi (eero at eero dot info)
8 years ago
If you need to convert images that are on CMYK format into RGB and want to preserve colour information, this may be helpful:

= new Imagick("CMYK_image.jpg"); // load image
$profiles = $image->getImageProfiles('*', false); // get profiles
$has_icc_profile = (array_search('icc', $profiles) !== false); // we're interested if ICC profile(s) exist

if ($has_icc_profile === false)
// image does not have CMYK ICC profile, we add one
$icc_cmyk = file_get_contents('/path/to/icc/SomeCMYKProfile.icc');
$image->profileImage('icc', $icc_cmyk);

// Then we need to add RGB profile
$icc_rgb = file_get_contents('/path/to/icc/SomeRGBProfile.icc');
$image->profileImage('icc', $icc_rgb);




There may be better and more elegant ways to do this, but hope this helped.
dadima, gmail
2 years ago
If profileImage() seems to be doing nothing — and "inverted colors" during a CMYK > RGB conversion is a sign of this — check that ImageMagick has the lcms delegate available.
From a command prompt:
convert -list configure | grep DELEGATES

If you don't see lcms in the list then Imagick won't do any color profile conversions, and won't give any warnings about this.  In that case, install the Little CMS library ( ) and recompile ImageMagick.
gavin at softyolk dot com
7 years ago
Thanks for this very valuable information.
For a further push in the correct direction please
consider that you have to download the profiles,

and your most likely sources are:


Note that the profiles are free, but you must install them
to make them available on you host system.
To Top