title: Apply built-in color profile to image
body: <p>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. </p>
  
  <p>I tried solve problem by image magick extension, but image still show different in different browsers:</p>
  
  <pre><code>    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-&gt;getImageProfiles();
  
  
              if(!$profiles)
                      return true;
  
              foreach($profiles as $name =&gt; $profile){
  
                      $im2-&gt;setImageProfile($name,$profile);
              }
  
              $im2-&gt;writeImage ($target_path);
  
              return true;
      }
  </code></pre>