Images from 'Annals of Internal Medicine' seen as negatively-colo(u)red by ImageMagick

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
RandomTroll
Posts: 15
Joined: 2017-12-28T11:38:17-07:00
Authentication code: 1152

Images from 'Annals of Internal Medicine' seen as negatively-colo(u)red by ImageMagick

Post by RandomTroll » 2019-07-11T04:08:24-07:00

ImageMagick displays images from 'Annals of Internal Medicine' as though they were negatively-colo(u)red.

Code: Select all

 convert -negate 
emits an image that ImageMagick displays 'correctly'. All other X-based image displayers (e.g., Firefox, Opera, Gimp) display them correctly. fbida-master fails, reporting 'unsupported color conversion'. Does anyone understand what's going on? Here is an example from a public(k)ly-available article, humorous, not medical:

https://annals.org/aim/fullarticle/2737 ... and-rounds

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

Re: Images from 'Annals of Internal Medicine' seen as negatively-colo(u)red by ImageMagick

Post by snibgo » 2019-07-11T05:32:49-07:00

What version of IM, on what platform? What was your complete command?

I suppose the image on that page you are interested in is g180047ff1_panel_1.jpg

That image is CMYK, with no embedded profile. I assume you want an sRGB image. Use one of these methods:

Code: Select all

magick g180047ff1_panel_1.jpg -colorspace sRGB out1.png

magick g180047ff1_panel_1.jpg -profile USWebCoatedSWOP.icc -profile sRGB.icc out2.png
out1.png uses a simple arithmetic conversion. out2.png guesses the input CMYK was encoded as USWebCoatedSWOP. If the ICC files are not in your current directory, use their full paths.
snibgo's IM pages: im.snibgo.com

RandomTroll
Posts: 15
Joined: 2017-12-28T11:38:17-07:00
Authentication code: 1152

Re: Images from 'Annals of Internal Medicine' seen as negatively-colo(u)red by ImageMagick

Post by RandomTroll » 2019-07-11T13:31:15-07:00

snibgo wrote:
2019-07-11T05:32:49-07:00
What version of IM, on what platform?
ImageMagick 6.9.10-53 Q16 x86_64 2019-07-06 https://imagemagick.org
Copyright: © 1999-2019 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP(4.5)
Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype jng jp2 jpeg lcms ltdl lzma openexr pangocairo png raw rsvg tiff webp wmf x xml zlib

linux. I update daily.
snibgo wrote:
2019-07-11T05:32:49-07:00

What was your complete command?

Code: Select all

display annals.jpeg
snibgo wrote:
2019-07-11T05:32:49-07:00
I suppose the image on that page you are interested in is g180047ff1_panel_1.jpg
yes.
snibgo wrote:
2019-07-11T05:32:49-07:00
I assume you want an sRGB image.
I just want to view it properly.

'magick' is not a command in Linux.
snibgo wrote:
2019-07-11T05:32:49-07:00
Use one of these methods:

Code: Select all

display -colorspace sRGB annals.jpeg
comes out correctly. Why is this necessary? Why doesn't ImageMagick detect the input color scheme and display it correctly?

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

Re: Images from 'Annals of Internal Medicine' seen as negatively-colo(u)red by ImageMagick

Post by snibgo » 2019-07-11T14:20:47-07:00

IM does what you tell it to do, and doesn't try to guess what you might want instead. It doesn't know if your output device is sRGB or AdobeRGB or P3 or whatever.
snibgo's IM pages: im.snibgo.com

Post Reply