File images display as negatives- why?

2011-09-24
2013-04-24
  • Jack Gregory
    Jack Gregory
    2011-09-24

    First the prelim: Jomic is fantastic. THANK YOU. Question: In the year(s?) I've been using Jomic,  a cbr file will occasionally open with image colors effectively reversed- displaying as pseudo "negatives". I haven't been able to isolate the reason for this. My solution has been to unpack the file and view the jpegged pages individually, which sidesteps the display problem. But even after re-zipping the file, the images still display as negatives. So, uh, why am this be?
    much thanks,
    Jack (OS X Leopard, MacPro with stuff)

     
  • Are the images in the CBR encoded as TIFF?

    There have been issues with Java's TIFF codec, for instance Sun bug #4511413 and Sub bug #4906850. And from the bug descriptions its not quite clear if all of them have been resolved.

    I've also noticed inverse images from time to time, though mostly when reading PDF. Internally, PDF documents often use TIFF to embed images.

     
  • Jack Gregory
    Jack Gregory
    2011-11-09

    Nope- they are jpgs, alright. I don't think it's something to do with Jomic specifically, however. When I open them in Zipeg, for instance, they also preview as negatives within Zipeg. However, AFTER the file has been unpacked, those same jpg images display correctly.
    But then, if I re-compress that same set of images / folder as a ZIP file (using the built-in OS X "compress" menu function)-, once again, the images display in the *negative*. S'weird.

     
  • Jack Gregory
    Jack Gregory
    2011-11-09

    oh, and same deal running Snow Leopard and now Lion.

     
  • Jack Gregory
    Jack Gregory
    2011-11-11

    Answer- I think I figured it out, it's caused by JPEGS with nonspecific / unassigned RGB color profiles.  The CBR files displaying as "negatives" have jpegs that were created with uncalibrated color spaces. They are RGB, not CMYK, but don't have specifically-assigned color spaces. Opening these individual jpegs in Photoshop (CS5) titles them as " RGB/8# " rather than " RGB/8 " - and their file info (again, in Photoshop CS5) notes them as "Color Space: Uncalibrated" via the "File Info" function, under the "Camera Data" tab.
    So it appears the way to fix this would be to open the individual JPEGs, then re-save them with assigned color spaces  for them to appear correctly in Jomic. I'm guessing this is a Mac OS X - only thing and that Windows does not have this problem-

     
  • Jack Gregory
    Jack Gregory
    2011-11-11

    Just tested in Jomic, and yes, after embedding the first JPEG with an sRGB profile while leaving the remainder as-is, the re-compressed  cbr file displays the first jpeg correctly, while the remainder are still displaying as negatives.

     
  • Thanks for your great analysis! I wonder if there is a way to recognize such JPEG images in Java after reading. It shouldn't be too difficult to add a default color space programmatically.

     
  • Jack Gregory
    Jack Gregory
    2011-11-14

    good question, I'm wondering the same thing, obviously, but sadly have 0 knowledge about Java, etc. I did a google search on your "recognize color profile JPEG images in Java" and the first result I got was this (see link), which might point towards an eventual solution- maybe it has something to do with the process of "flattening", wtf idk ha. Stackoverflow.com in general seems to be a popular place for these kinds of discussions
    http://stackoverflow.com/questions/1271658/why-java-imageio-flattens-jpeg-colors

     
  • Jack Gregory
    Jack Gregory
    2011-11-14

    Oh- I just had a  thought- maybe an alternate / better solution would be to have a default color profile *assigned* (or effectively swapped out) by the Jomic app itself, rather than read from the file- that way it would't matter whether or not a color profile wasn't already embedded, or incorrect, or whatever. If that is possible- again, I have no clue.