Can't remove ICC profile when writing miff files

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
snibgo
Posts: 11579
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Can't remove ICC profile when writing miff files

Post by snibgo » 2019-01-17T17:50:42-07:00

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
snibgo's IM pages: im.snibgo.com

User avatar
magick
Site Admin
Posts: 10957
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick » 2019-01-18T19:06:07-07:00

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

snibgo
Posts: 11579
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post by snibgo » 2019-01-18T19:51:52-07:00

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}
snibgo's IM pages: im.snibgo.com

User avatar
magick
Site Admin
Posts: 10957
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick » 2019-01-19T06:32:25-07:00

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.

Post Reply