Page 1 of 1

Can't remove ICC profile when writing miff files

Posted: 2019-01-17T17:50:42-07:00
by snibgo
Tested with IM v7.0.7-28 on Windows 8.1.

"-strip" and "+profile *" don't remove ICC profiles when the output is miff format.

For example, create an image, assign a profile, remove it, and save as miff. Then examine the miff for an ICC profile:

Code: Select all

f:\web\im>%IMG7%magick xc: -profile sRGB.icc +profile "*" x.miff

Code: Select all

f:\web\im>%IMG7%magick x.miff -verbose info: |grep icc
    icc:copyright: Copyright 2007 International Color Consortium
    icc:description: sRGB v4 ICC preference perceptual intent beta
    icc:manufacturer: sRGB v4 ICC preference perceptual intent beta
    icc:model: sRGB v4 ICC preference perceptual intent beta
Try again with "-strip":

Code: Select all

f:\web\im>%IMG7%magick xc: -profile sRGB.icc -strip x.miff

f:\web\im>%IMG7%magick x.miff -verbose info: |grep icc
    icc:copyright: Copyright 2007 International Color Consortium
    icc:description: sRGB v4 ICC preference perceptual intent beta
    icc:manufacturer: sRGB v4 ICC preference perceptual intent beta
    icc:model: sRGB v4 ICC preference perceptual intent beta


A workaround is to write to tiff instead of miff.

Code: Select all

f:\web\im>%IMG7%magick xc: -profile sRGB.icc +profile "*" x.tiff

f:\web\im>%IMG7%magick x.tiff -verbose info: |grep icc

f:\web\im>%IMG7%magick xc: -profile sRGB.icc -strip x.tiff

f:\web\im>%IMG7%magick x.tiff -verbose info: |grep icc

Re: Can't remove ICC profile when writing miff files

Posted: 2019-01-18T19:06:07-07:00
by magick
The ICC profile is removed, however, the ICC properties remain because you did not explicitly delete them. Try this instead:

Code: Select all

magick xc: -profile sRGB.icc +profile "*" +set "icc:copyright" +set "icc:description" x.miff

Re: Can't remove ICC profile when writing miff files

Posted: 2019-01-18T19:51:52-07:00
by snibgo
Okay, thanks, but the ICC properties are automatically removed when the output is TIFF, even though I didn't explicitly delete them.

Code: Select all

f:\web\im>%IMG7%magick xc: -profile sRGB.icc x2.tiff

f:\web\im>%IMG7%magick identify -verbose x2.tiff |grep icc
    icc:copyright: Copyright 2007 International Color Consortium
    icc:description: sRGB v4 ICC preference perceptual intent beta
    icc:manufacturer: sRGB v4 ICC preference perceptual intent beta
    icc:model: sRGB v4 ICC preference perceptual intent beta
    Profile-icc: 60960 bytes

Code: Select all

f:\web\im>%IMG7%magick xc: -profile sRGB.icc +profile "*" x3.tiff

f:\web\im>%IMG7%magick identify -verbose x3.tiff |grep icc
{no output}

Re: Can't remove ICC profile when writing miff files

Posted: 2019-01-19T06:32:25-07:00
by magick
MIFF and MPC image formats are designed to persist image properties and artifacts so they can be faithfully restored when the image is reread in an image pipeline. Other formats may not support certain image properties such as those in the ICC namespace or if the format specification permit tagged fields such as TIFF, ImageMagick may not yet have support to persist them.