title: GraphicsMagick - Identify and remove attached color profile
body: <p>I have some tiff images that have an embedded color profile (the example one is <code>Canon EOS-1Ds flash</code>). 
  When I convert them to jpeg (<code>gm convert source.tif target.jpeg</code>) the resulting jpeg colours are distorted in browsers (Chrome,Firefox, but not IE) but not in system image viewers. </p>
  
  <p>If I open the source in GIMP Image Editor, and change the colour profile to  <code>sRGB</code>, then the image from the above convert command displays correctly in browsers. </p>
  
  <p>So I have this question:</p>
  
  <blockquote>
    <p>How can I identify the fact that an image has an embedded color
    profile using graphicsmagick?</p>
  </blockquote>
  
  <p>It looks like with this command the profile is removed:</p>
  
  <pre><code>mogrify +profile '*' -define jpeg:preserve-settings
  </code></pre>
  
  <p>Here is the output from <code>gm identify -verbose source.tif</code></p>
  
  <pre><code>Image: Di 2007-1337.tif
    Format: TIFF (Tagged Image File Format)
    Geometry: 4053x2257
    Class: DirectClass
    Type: true color
    Depth: 8 bits-per-pixel component
    Channel Depths:
      Red:      8 bits
      Green:    8 bits
      Blue:     8 bits
    Channel Statistics:
      Red:
        Minimum:                     0.00 (0.0000)
        Maximum:                   255.00 (1.0000)
        Mean:                      135.75 (0.5324)
        Standard Deviation:         72.49 (0.2843)
      Green:
        Minimum:                     0.00 (0.0000)
        Maximum:                   255.00 (1.0000)
        Mean:                      129.79 (0.5090)
        Standard Deviation:         72.87 (0.2858)
      Blue:
        Minimum:                     0.00 (0.0000)
        Maximum:                   255.00 (1.0000)
        Mean:                      125.43 (0.4919)
        Standard Deviation:         73.42 (0.2879)
    Resolution: 400x400 pixels/inch
    Filesize: 26.4M
    Interlace: No
    Orientation: Unknown
    Background Color: white
    Border Color: #DFDFDF
    Matte Color: #BDBDBD
    Compose: Over
    Dispose: Undefined
    Iterations: 0
    Compression: No
    Signature: bec78e9402b39f6f5539a640715270a651a39c2238846fa42f37c1c7d99af747
    Profile-color: 219244 bytes
    Profile-iptc: 4358 bytes
      unknown:
  
      Byline:
    Rod 
      Source:
    Rod 
      Created Date:
    20061006
      Created Time:
    110014+0000
      Originating Program:
    Capture One PRO
      Program Version:
    3.7.1
      unknown:
    0x00000000: ffffff5c 2c3bff65 2dffff39 ffffff55 ff5bff27  ----\,;-e---9---U-[-
    0x00000014: ffffffff ff7affff ffffff48 103a29ff ff17ff58  '-----z-----H-:)----
    0x00000028: ff616363 3dffffff ffffffff ff777a63 6537ff19  X-acc=--------wzce7-
    0x0000003c: ffffffff 3c57ffff ff3c6674 ffff5f67 ff71ffff  -----&lt;W---&lt;
    0x00000050: 74ffff5f 67ff71ff ff00                        ft--_
    Tainted: False
    User Time: 0.030u
    Elapsed Time: 0:01
    Pixels Per Second: 290.8M
  </code></pre>
  
  <p>The converted image from the following, is broken within OS image viewers as well:</p>
  
  <pre><code>  Format: TIFF (Tagged Image File Format)
    Geometry: 4992x3328
    Class: DirectClass
    Type: true color
    Depth: 8 bits-per-pixel component
    Channel Depths:
      Red:      8 bits
      Green:    8 bits
      Blue:     8 bits
    Channel Statistics:
      Red:
        Minimum:                     0.00 (0.0000)
        Maximum:                   255.00 (1.0000)
        Mean:                      213.55 (0.8374)
        Standard Deviation:         57.03 (0.2237)
      Green:
        Minimum:                     0.00 (0.0000)
        Maximum:                   255.00 (1.0000)
        Mean:                       40.76 (0.1598)
        Standard Deviation:         92.06 (0.3610)
      Blue:
        Minimum:                     0.00 (0.0000)
        Maximum:                   255.00 (1.0000)
        Mean:                      161.49 (0.6333)
        Standard Deviation:        121.23 (0.4754)
    Resolution: 300x300 pixels/inch
    Filesize: 47.6M
    Interlace: No
    Orientation: TopLeft
    Background Color: white
    Border Color: #DFDFDF
    Matte Color: #BDBDBD
    Compose: Over
    Dispose: Undefined
    Iterations: 0
    Compression: No
    Artist: Gary 
    Timestamp: 2006:11:12 12:35:12
    Make: Canon
    Model: Canon EOS-1Ds Mark II
    Software: Adobe Photoshop CS2 Macintosh
    Signature: 1b26f2c2122ea6aa391a40c7eb885d0da120x8e9x5bd7ce0dc7cc9038ba99737
    Profile-iptc: 12926 bytes
      unknown:
  
      Byline:
    Gary Ombler
      Originating Program:
    Capture One PRO
      Program Version:
    3.7.3
      unknown:
    #Q�$�'���߸︥�[��Rҝ5��n�b����h�
    Profile-XMP: 17293 bytes
    Tainted: False
    User Time: 0.140u
    Elapsed Time: 0:01
    Pixels Per Second: 45.3M
  </code></pre>