How to embed an ICC profile into output file with the "montage" program?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
yup
Posts: 8
Joined: 2016-04-10T04:32:49-07:00
Authentication code: 1151

How to embed an ICC profile into output file with the "montage" program?

Post by yup »

According to http://www.imagemagick.org/script/montage.php the "montage" program supports a "-profile" option. And really, usage of this parameter does not produce any error messages. But it creates output file without embedded profile.

For example (simplest):

Code: Select all

montage a.jpg -profile a.icc a.tif
- produces "c.tif" that does not contain profile.

At the same time

Code: Select all

convert a.jpg -profile a.icc a.tif
- produces "c.tif" with embedded profile.

So, is documentation wrong, or am I missing something?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to embed an ICC profile into output file with the "montage" program?

Post by snibgo »

Please, always provide the IM version number.

From experiments with v6.9.2-5, it seems that montage can successfully convert an image to a profile, but it never embeds the profile in the output file. I think it should, and that this is a bug.

Worse, if in.jpg has an embedded profile, then

Code: Select all

montage in.jpg out.jpg
... will silently strip the profile.
snibgo's IM pages: im.snibgo.com
yup
Posts: 8
Joined: 2016-04-10T04:32:49-07:00
Authentication code: 1151

Re: How to embed an ICC profile into output file with the "montage" program?

Post by yup »

snibgo wrote:Please, always provide the IM version number.
I tried v7.0.0-0, v6.9.3-7, and yet one release of v6.9.3 (can't tell its exact revision because it's on a computer at work).
snibgo wrote:Worse, if in.jpg has an embedded profile, then

Code: Select all

montage in.jpg out.jpg
... will silently strip the profile.
If I am not wrong, this behaviour is normal: while convert uses its first source image as a base for output image, so output may silently inherit some attributes from this base (if it is a file), montage always creates output image from scratch, and thus out.jpg has nothing to inherit.
snibgo wrote:From experiments with v6.9.2-5, it seems that montage can successfully convert an image to a profile, but it never embeds the profile in the output file. I think it should, and that this is a bug.
Should I report it on a corresponding forum?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How to embed an ICC profile into output file with the "montage" program?

Post by snibgo »

You can post to the Bugs forum viewforum.php?f=3 with a link to this thread.

I see what you mean about montage creating images from scratch. I don't use montage, so I don't really know what it does, or what it should do, about colorspaces and profiles.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to embed an ICC profile into output file with the "montage" program?

Post by fmw42 »

Until your get a reply from the developers whether -profile should work in montage (and I get error messages that seem to imply that it does not), then just pipe the output to convert to add the profile

Code: Select all

montage rose: rose: rose: -tile 3x1 miff:- | convert - -profile /Users/fred/images/profiles/sRGB.icc rose_montage.jpg

Code: Select all

identify -verbose rose_montage.jpg
Image: rose_montage.jpg
Format: JPEG (Joint Photographic Experts Group JFIF format)
Mime type: image/jpeg
Class: DirectClass
Geometry: 384x126+0+0
Units: Undefined
Type: TrueColor
Endianess: Undefined
Colorspace: sRGB
Depth: 8-bit
...
Properties:
date:create: 2016-04-13T12:43:22-07:00
date:modify: 2016-04-13T12:43:22-07:00
icc:copyright: sRGB built-in
icc:description: sRGB built-in
icc:manufacturer: (lcms internal)
icc:model: sRGB built-in

jpeg:colorspace: 2
jpeg:sampling-factor: 1x1,1x1,1x1
signature: ff93238d9e1cb70ac2d336a7ee87f4f415828694431a9254d46ddb4a9f56c8f4
Profiles:
Profile-icc: 6876 bytes
yup
Posts: 8
Joined: 2016-04-10T04:32:49-07:00
Authentication code: 1151

Re: How to embed an ICC profile into output file with the "montage" program?

Post by yup »

fmw42 wrote:just pipe the output to convert to add the profile

Code: Select all

montage rose: rose: rose: -tile 3x1 miff:- | convert - -profile /Users/fred/images/profiles/sRGB.icc rose_montage.jpg
This is almost exactly what I do. "Almost" - because I create very large files (typically 8-10 GB for LZW-compressed tiff64 output), and under Windows pipe is not very effective (uses an intermediate temporary file), so in this case I prefer to create such file explicitly.
Post Reply