The Imagick::profileImage() function is an inbuilt function in PHP which is used to add or remove profile from an image. If the profile is NULL, it is removed from the image otherwise added.
About ICC image profiles: In color management, an ICC profile is a set of data that characterizes a color input or output device, or a color space, according to standards promulgated by the International Color Consortium (ICC). Color space means a specific organization of colors.
Syntax:
bool Imagick::profileImage( $name, $profile )
Parameters: This function accepts two parameters as mentioned above and described below:
- $name: This parameter holds the name of profile of an image.
- $profile: This parameter holds the content of the profile file.
Return Value: This function returns true on success.
Below program illustrates the Imagick::profileImage() function in PHP:
Program:
<?php // Create an Imagick object $image = new Imagick( // Get profiles attached to the image $profiles = $image->getImageProfiles('*', false); // Checking for any icc profile added to the image $has_icc_profile = (array_search('icc', $profiles) !== false); if ($has_icc_profile === false) { // If image does not have ICC profile, then add one $icc = file_get_contents('D:\\Merawamp\\www\\New\\to\\icc\\CMYK.icc'); // Use Imagick::profileimage() function to add the // profile to an image the profile added to the // image is the file D:\\Merawamp\\www\\New\\to\\icc\\CMYK.icc $trip1 = $image->profileImage('icc', $icc); } // If method runs successfully it retuens true if($trip1 == true) { echo "Profile added to image successfully"; } ?> |
Output:

Recommended Posts:
- PHP | Gmagick profileimage() Function
- PHP | Imagick floodFillPaintImage() Function
- PHP | Imagick adaptiveSharpenImage() Function
- PHP | Imagick flopImage() Function
- PHP | Imagick setImageExtent() Function
- PHP | Imagick getImageWhitePoint() Function
- PHP | Imagick getCompressionQuality() Function
- PHP | Imagick clear() Function
- PHP | Imagick annotateImage() Function
- PHP | Imagick adaptiveResizeImage() Function
- PHP | Imagick adaptiveBlurImage() Function
- PHP | Imagick adaptiveThresholdImage() Function
- PHP | Imagick addNoiseImage() Function
- PHP | Imagick colorizeImage() Function
- PHP | Imagick addImage() Function
- PHP | Imagick setImageDispose() Function
- PHP | Imagick borderImage() Function
- PHP | Imagick getImageMatte() Function
- PHP | Imagick getImageMimeType() Function
- PHP | Imagick getImageRenderingIntent() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : nidhi_biet

