About ICC Image Profiles. In color management, ICC Profile - it is a set of data that characterizes a color input or output device or color space in accordance with the standards adopted by the International Color Consortium (ICC). A color space refers to a specific arrangement of colors.
Syntax:bool Imagick::profileImage ($name, $profile)
Parameters: This function takes two parameters as above and described below:
- $name:this parameter contains the name of the picture profile.
- $profile:this parameter contains the content of the profile file.
Return value: this function returns true on success.The following program illustrates the Imagick::profileImage() function in PHP:
Program :
// Create an Imagick object
$image
=
new
Imagick (
" https://media.engineerforengineer.org/wp-content/uploads/engineerforengineer-9.png "
);
// Get the profiles attached to the image
$profiles
=
$image
-> getImageProfiles (
’*’
, false);
// Check any icc profile added to the image
$has_icc_profile
= (
array_search
(
’icc’
,
$profiles
)! == false);
if
(
$has_icc_profile
= == false) {
// If the image does not have an ICC profile, add it
$icc
=
file_get_contents
(
’ D: Merawamp www New to icc CMYK.icc’
);
// Use the Imagick::profileimage() function to add
// profile to profile added to image
// image is a file D: // Merawamp // www //New//to//icc//CMYK.icc
$trip1
=
$image
-> profileImage (
’icc’
,
$icc
);
}
// If the method succeeds, it returns true
if
(
$trip1
== true) {
echo
"Profile added to image successfully"
;
}
?>
Output: