LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-02-2019, 08:25 PM   #1
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,953

Rep: Reputation: 270Reputation: 270Reputation: 270
Pictures from 'Annals of Internal Medicine' don't display properly


When I try to display a picture from 'Annals of Internal Medicine', such as the one associated with https://annals.org/aim/fullarticle/2...m-grand-rounds (humorous, not medical) , fbi gives me an error, ImageMagick displays it in reverse colors. Firefox gets it right. Does anyone see what the problem is?
 
Old 07-02-2019, 09:32 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,311
Blog Entries: 28

Rep: Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137
I downloaded the image and opened it in Firefox, Kolourpaint, Krita, Geegie, Okular, and Gwenview, and the colors looked the same in each.

In ImageMagick, though, the colors were indeed reversed.

I have no idea why. I usually use GIMP.

Last edited by frankbell; 07-02-2019 at 09:38 PM.
 
Old 07-02-2019, 09:52 PM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,623

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
i can confirm "display" reverses the color and so dose Nip2

gimp , Gmic , Gwenview, Okular all display it correctly

and "gdalinfo" looks fine to me
Code:
gdalinfo g180047ff1_panel_1.jpeg
Driver: JPEG/JPEG JFIF
Files: g180047ff1_panel_1.jpeg
Size is 1024, 1432
Coordinate System is `'
Metadata:
  EXIF_BitsPerSample=8 8 8 8
  EXIF_ColorSpace=65535
  EXIF_Compression=1
  EXIF_DateTime=2019:06:20 11:10:46
  EXIF_Orientation=1
  EXIF_PhotometricInterpretation=5
  EXIF_PixelXDimension=1024
  EXIF_PixelYDimension=1432
  EXIF_PlanarConfiguration=1
  EXIF_ResolutionUnit=2
  EXIF_SamplesPerPixel=4
  EXIF_Software=Adobe Photoshop CS4 Windows
  EXIF_XResolution=(300)
  EXIF_YResolution=(300)
Image Structure Metadata:
  COMPRESSION=JPEG
  INTERLEAVE=PIXEL
  SOURCE_COLOR_SPACE=YCbCrK
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0, 1432.0)
Upper Right ( 1024.0,    0.0)
Lower Right ( 1024.0, 1432.0)
Center      (  512.0,  716.0)
Band 1 Block=1024x1 Type=Byte, ColorInterp=Red
  Overviews: 512x716, 256x358, 128x179, 114x160
  Image Structure Metadata:
    COMPRESSION=JPEG
Band 2 Block=1024x1 Type=Byte, ColorInterp=Green
  Overviews: 512x716, 256x358, 128x179, 114x160
  Image Structure Metadata:
    COMPRESSION=JPEG
Band 3 Block=1024x1 Type=Byte, ColorInterp=Blue
  Overviews: 512x716, 256x358, 128x179, 114x160
  Image Structure Metadata:
    COMPRESSION=JPEG
except for this
Quote:
EXIF_BitsPerSample=8 8 8 8
there is an alpha channel in the image and both display and nip2 do not handle this well

once i flattened the image ( remove the alpha channel)
"display" showed it correctly

Last edited by John VV; 07-02-2019 at 10:00 PM.
 
1 members found this post helpful.
Old 07-03-2019, 08:18 AM   #4
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,953

Original Poster
Rep: Reputation: 270Reputation: 270Reputation: 270
Quote:
Originally Posted by frankbell View Post
I downloaded the image and opened it in Firefox, Kolourpaint, Krita, Geegie, Okular, and Gwenview, and the colors looked the same in each.
Those all use X, which I try not to use.

Quote:
Originally Posted by John VV View Post
gimp , Gmic , Gwenview, Okular all display it correctly
X

Quote:
Originally Posted by John VV View Post
there is an alpha channel in the image and both display and nip2 do not handle this well

once i flattened the image ( remove the alpha channel)
"display" showed it correctly
Thanks. I already fix-up articles from 'Annals', so I can add this to the process. How do you remove the alpha channel?
 
Old 07-04-2019, 10:59 AM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,623

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
How do you remove the alpha channel?
in gimp

open the image in gimp and select

image / flatten image

Then resave it
 
Old 07-06-2019, 12:18 AM   #6
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,953

Original Poster
Rep: Reputation: 270Reputation: 270Reputation: 270
Quote:
Originally Posted by John VV View Post
in gimp
I want something automatic, and not-X
Code:
convert -alpha deactivate image.jpeg
and
Code:
convert -flatten image.jpeg
don't work.
 
Old 07-06-2019, 03:19 AM   #7
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Try this:
Code:
convert filename.jpg -alpha off filename.jpg
or
Code:
convert filename.jpg -alpha off filename.no-alpha.jpg
if you want to keep the original.
 
Old 07-06-2019, 03:19 AM   #8
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by RandomTroll View Post
I want something automatic, and not-X
Code:
convert -alpha deactivate image.jpeg
and
Code:
convert -flatten image.jpeg
don't work.
According to the man page convert needs BOTH input and output file in the commandline.
So your usage with only a single filename will not work.
 
Old 07-06-2019, 09:41 AM   #9
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,953

Original Poster
Rep: Reputation: 270Reputation: 270Reputation: 270
Quote:
Originally Posted by ehartman View Post
According to the man page convert needs BOTH input and output file in the commandline.
So your usage with only a single filename will not work.
I omitted the output file name in my examples inadvertently. In practice I used them.

Quote:
Originally Posted by crts View Post
Try this:
Code:
convert filename.jpg -alpha off filename.jpg
or
Code:
convert filename.jpg -alpha off filename.no-alpha.jpg
if you want to keep the original.
alpha off doesn't work.

Last edited by RandomTroll; 07-06-2019 at 09:44 AM.
 
Old 07-06-2019, 06:21 PM   #10
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Two steps worked for me:

Code:
convert filename.jpeg -alpha off filename.png
convert filename.png -alpha off filename.no-alpha.jpeg
The *.png file was displayed correctly for me, so you might want to leave it as *.png, if this format is acceptable.

It also works if I omit the '-alpha off' option but I guess it won't hurt to leave it as is.
 
Old 07-07-2019, 06:31 AM   #11
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,953

Original Poster
Rep: Reputation: 270Reputation: 270Reputation: 270
Quote:
Originally Posted by crts View Post
Two steps worked for me:
I've always known that I could convert to a different format then back. I want to know what the difference is. file reports:
Quote:
DrMomGrandRounds_AIM-20190702.jpeg: JPEG image data, Exif standard: [TIFF image data, little-endian, direntries=15, height=1432, bps=194, compression=none, PhotometricIntepretation=CMYK, orientation=upper-left, width=1024], baseline, precision 8, 1024x1432, components 4
DrMomGrandRounds_AIM-20190702.jpg: JPEG image data, JFIF standard 1.01, resolution (DPI), density 300x300, segment length 16, baseline, precision 8, 1024x1432, component
ImageMagick & fbi know about EXIF; I have the EXIF libraries installed and they link to them. I can convert to a TIFF file that works. Is it an improperly-interpreted PhotometricIntepretation? Have they missed that and tried to interpret it as RGB? That's my best guess.
 
Old 07-08-2019, 03:51 AM   #12
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
So, first you have been presented with a solution which was not good enough because
Quote:
Originally Posted by RandomTroll View Post
I want something automatic, and not-X
and the solution you had in mind did not work as intended:
Quote:
Originally Posted by RandomTroll View Post
Code:
convert -alpha deactivate image.jpeg
and
Code:
convert -flatten image.jpeg
don't work.
Then your syntax has been corrected for the 'convert' command and you have subsequently been offered a solution that does not require X and can be very well automated, thus fulfilling your requrirement.

This, however, only lead to you posting that you "knew" that all along which contradicts your previous posts.
Quote:
Originally Posted by RandomTroll View Post
I've always known that I could convert to a different format then back.
Please make up your mind about what you actually want and stop wasting everyones time. Thank you.

Last edited by crts; 07-08-2019 at 06:13 AM.
 
Old 07-08-2019, 04:44 PM   #13
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,953

Original Poster
Rep: Reputation: 270Reputation: 270Reputation: 270
Quote:
Originally Posted by crts View Post
first you have been presented with a solution which was not good enough because

and the solution you had in mind did not work as intended:

Then your syntax has been corrected for the 'convert' command and you have subsequently been offered a solution that does not require X and can be very well automated, thus fulfilling your requrirement.
I did not ask for a solution: I asked what was wrong. I meant how fbi and ImageMagick mis-interpreted the image so as to display the colo(u)rs backwards.

Responders responded with solutions that I treated as diagnostics, pointed out that they didn't answer my question. That spun off into a discussion of solutions.
 
Old 07-09-2019, 02:44 PM   #14
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Quote:
Originally Posted by RandomTroll View Post
I did not ask for a solution: I asked what was wrong.
Sorry, but no, your initial post is not unambiguous in this regard and after you received answers on fixing/working around the issue you made three posts where you did not clarify that you are not looking for solutions. Especially in post #4 you are asking:
Quote:
Originally Posted by RandomTroll View Post
How do you remove the alpha channel?
Even if your initial post would have been crystal clear on your requirement, this is definitely a follow up question. You also present your failed attempts in trying to remove the alpha channel which can only be understood as, well, you are looking for a solution to remove the alpha channel.

Quote:
Originally Posted by RandomTroll View Post
Responders responded with solutions that I treated as diagnostics, pointed out that they didn't answer my question.
The only thing you pointed out was that you are not looking for solutions that require X:
Quote:
Originally Posted by RandomTroll View Post
Those all use X, which I try not to use.
Quote:
Originally Posted by RandomTroll View Post
I want something automatic, and not-X

Anyway, I did not see anything in the manpage that would explain this behaviour. No additional steps *should* be required - like passing some extra options - to display a JPEG image.
When I run 'identify' in a shell on the image then I get
Code:
$ identify annals.jpeg
annals.jpeg JPEG 1024x1432 1024x1432+0+0 8-bit CMYK 303KB 0.000u 0:00.009
It seems that ImageMagick falsely (??) identifies the color scheme as CMYK which may explain the behaviour we are seeing. At this point the best course of action might be to contact the developers and file a bug report.

PS:
I am using ImageMagick 6.9.4-9 on Slackware 14.2. You might want to try with a newer version before filing a Bug report and see if the issue still persists.

Last edited by crts; 07-09-2019 at 02:58 PM. Reason: Added version info for ImageMagick
 
Old 07-09-2019, 03:53 PM   #15
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,953

Original Poster
Rep: Reputation: 270Reputation: 270Reputation: 270
Quote:
Originally Posted by crts View Post
your initial post is not unambiguous in this regard
It is clear.

Quote:
Originally Posted by crts View Post
after you received answers on fixing/working around the issue you made three posts where you did not clarify that you are not looking for solutions.
I thought it superfluous.

Quote:
Originally Posted by crts View Post
Even if your initial post would have been crystal clear on your requirement, this is definitely a follow up question.
It was a follow-up question to test the hypothesis. A responder said it was the alpha channel. To test that hypothesis I had to know how to remove the alpha channel. The ImageMagick function that would seem to do that made no difference.

Quote:
Originally Posted by crts View Post
You also present your failed attempts in trying to remove the alpha channel which can only be understood as, well, you are looking for a solution to remove the alpha channel.
A solution to remove the alpha channel, so as to test the hypothesis that the alpha channel was the problem.

Quote:
Originally Posted by crts View Post
It seems that ImageMagick falsely (??) identifies the color scheme as CMYK
What makes you think the colo(u)r scheme isn't CMYK? file thinks it is.

Quote:
Originally Posted by crts View Post
I am using ImageMagick 6.9.4-9 on Slackware 14.2. You might want to try with a newer version before filing a Bug report and see if the issue still persists.
I update to Slackware's latest every morning. Sometimes I'm a day behind. Latest made no difference.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: GPL Medicine: What Medsphere Will Try Next LXer Syndicated Linux News 0 02-17-2007 06:01 AM
LXer: Vista Gets Taste of Linux Medicine LXer Syndicated Linux News 0 02-14-2007 03:16 PM
LXer: Industry, Academia, Medicine And Government Leaders Team Up To Tackle Personal Health Records LXer Syndicated Linux News 0 07-27-2006 07:54 AM
LXer: Open source and open medicine take centre stage at UN research symposium LXer Syndicated Linux News 0 04-13-2006 06:54 AM
Medicine Software fisayo Linux - Software 3 01-02-2006 05:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration