Re: Problems reading JPG files

Posted by ctrueden on
URL: http://imagej.273.s1.nabble.com/Problems-reading-JPG-files-tp5017133p5017137.html

Hi Paul,

> I do see the SCIFIO beta is selected and when I deselect it the images
> are read properly, at least consistent with what I have seen in the
> past.

Glad to hear it.

> I have attached a screen shot of the image read with the SCIFIO option
> deselected (upper) and with it selected. Is this a bug?

It is intended behavior. JPEG files have three color channels—in the case
of grayscale data, the values are just replicated across R, G and B. SCIFIO
inspects the JPEG, detects three channels, and reads them in. Whereas IIRC,
ImageJ 1.x has a special case whereby multichannel images which contain the
same information across each channel get automagically converted to 8-bit
after being read in. This is probably what is happening with your image.

IMHO, this automagical conversion is overzealous, and SCIFIO should not do
this. However, there might be something in the JPEG header that SCIFIO
could use to differentiate between a JPEG which is intended to be
grayscale, vs. an RGB one that happens to have the same values across all
three channels.

I filed an issue so we remember to consider the best way forward here:
https://github.com/scifio/scifio/issues/327

> Will one continue to have an option to use this or not, or is it the
> direction ImageJ is headed?

The ultimate goal of the ImageJ2 project is to replace all ImageJ 1.x
functionality, but that is still several years away. Until that happens,
the SCIFIO toggle will continue to exist. And the option will stay off by
default until the SCIFIO readers and architecture are fully stabilized and
offer a complete replacement for the I/O capabilities of ImageJ 1.x.

Regards,
Curtis

--
Curtis Rueden
LOCI software architect - http://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - http://imagej.net/User:Rueden
Did you know ImageJ has a forum? http://forum.imagej.net/


On Tue, Aug 30, 2016 at 8:09 AM, Stutzman, Paul E. (Fed) <
[hidden email]> wrote:

> Curtis,
>
> Thanks for the quick reply.  I am not sure how to reply to the daily
> ImageJ set of messages so I will reply individually.  I do see the SCIFIO
> beta is selected and when I deselect it the images are read properly, at
> least consistent with what I have seen in the past.  I have attached a
> screen shot of the image read with the SCIFIO option deselected (upper) and
> with it selected. Is this a bug?  Will one continue to have an option to
> use this or not, or is it the direction ImageJ is headed?
>
> I appreciate your pointing this out as it had me stopped cold.
>
> Thanks,  Paul
>
>
> Paul Stutzman
> Materials and Structural Systems Division
> 100 Bureau Drive
> Gaithersburg, MD 20899-8615
> 301 975-6715, 6645 (lab)
> [hidden email]
>
>
>
>
>
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

Screen Shot 2016-08-30 at 9.00.06 AM.png (996K) Download Attachment