Colorspace conversions when not called

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.
Locked
btully
Posts: 3
Joined: 2019-10-29T14:47:42-07:00
Authentication code: 1152

Colorspace conversions when not called

Post by btully »

Running 7.0.8-68 on Mac OS X 14.6
Called from command line.
Arguments are [source path, -resize 10%, -flatten, destination path]

Images are converting from CMYK to RGB, maintaining the same ICC profile.
Visually, images are inverting, like a film negative.

Input files are CMYK TIFFs, SWOP3, 7000 + pixels on the long side.
Output are JPEGs.

Updating the arguments to
[source path, -colorspace RGB, -resize 10%, -flatten, -colorspace CMYK, destination path]
prevents the inversion, but dramatically darkens the image.

previous version, 7.0.8-47 worked normally

btully
Posts: 3
Joined: 2019-10-29T14:47:42-07:00
Authentication code: 1152

Re: Colorspace conversions when not called

Post by btully »

Running arguments
[source path, -colorspace CMYK, -resize 10%, -flatten, -colorspace CMYK, destination path] or
[source path, -resize 10%, -flatten, -colorspace CMYK, destination path]
both produce CMYK images, but same inversion of colors.

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

Re: Colorspace conversions when not called

Post by snibgo »

I confirm that this used to work in 7.0.7-28, but fails in 7.0.8-64.

The problem is that "-flatten" changes the colorspace to sRGB. It shouldn't, so this seems to be a bug.

A workaround for this example is "-set colorspace CMYK" after "-flatten".
snibgo's IM pages: im.snibgo.com

btully
Posts: 3
Joined: 2019-10-29T14:47:42-07:00
Authentication code: 1152

Re: Colorspace conversions when not called

Post by btully »

snibgo,
Thank you for the workaround. I am using that with success.

Locked