I have one JPEG-picture with embeded color profile. Some web-browsers show image with applied profile, some not. How to apply color profile to image and delete profile, that all browsers display image identically.
I tried solve problem by image magick extension, but image still show different in different browsers:
function add_color_profiles($source_path, $target_path){
$all_exts = get_loaded_extensions();
if(!in_array('imagick',$all_exts))
return true;
$im1 = new Imagick($source_path);
$im2 = new Imagick($target_path);
$profiles = $im1->getImageProfiles();
if(!$profiles)
return true;
foreach($profiles as $name => $profile){
$im2->setImageProfile($name,$profile);
}
$im2->writeImage ($target_path);
return true;
}
Apply a color profile to the image: Choose Tools > Assign Profile, select a color profile, then click OK. See what an image would look like on a different device: Choose View > Soft Proof with Profile, then select a color profile.
Photoshop can embed profiles in PNG just make sure that you don't save the PNG using the "Save for Web..." feature (which incidentally also strips color profiles from your JPEGs too). Use "Save As..." to save for PNG and it will embed the color profile.
You can access this command from the image menu bar through Image → Color Management → Assign Color Profile.
Apply profile to an image (convert image colorspace to RGB):
$im->setImageColorspace(IMagick::COLORSPACE_RGB);
Strip profile information from an output file:
$im->profileImage('*', NULL);
Strip an image of all profiles, exif (comments GPS data etc.):
$im->stripImage();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With