Login  Register

Re: Incorrect density values when quantifying PNG files exported from GIMP

Posted by Robert Baer on Nov 20, 2012; 9:47pm
URL: http://imagej.273.s1.nabble.com/Incorrect-density-values-when-quantifying-PNG-files-exported-from-GIMP-tp5000862p5000906.html

On 11/20/2012 2:38 PM, Garvalov, Boyan wrote:
> - This issue indeed appears to be at the heart of the problem, but I
> actually cannot give you a straight answer right now. I can only tell
> you the following:
-- snip --
> 4) The problem only occurs when I copy (a part of) one image and paste
> it into a new file in GIMP which I then export as png from GIMP. In
> that case it doesn’t help if I tell GIMP to open the new file as
> grayscale and it makes no difference if I define the fill color as
> white, foreground (black) or transparent.
If you look at the layers tab in GIMP, you will see that a new GIMP
image by default has a [blank] background layer (like photoshop). When
you paste your copied image to the image there are now two layers that
get saved. Both .tif and .png formats support saving multilayered
images. .jpg does not. When you flatten the image as Wayne suggested,
you are collapsing all the layers of the image into a single layer with
layers higher in the layer stack "writing over" layers lower in the
stack. ImageJ treats "layers" as stack frames which have different and
more complex meanings in different contexts (time, color channel,
z-depth, etc.). My guess is that everything that happens when using GIMP
would have similar behavior in Photoshop although I think newer versions
of Photoshop have better support for 16-bit images. The GIMP behavior is
not necessarily a bug, but rather a different perspective on how to
treat multiframe images. This probably also explains the first sentence
of #5 below.

> 5) If I first export the file as jpg in GIMP and then re-export it as
> png in GIMP, I get correct density values in ImageJ. However, if I
> first export the file as tif and then re-export it as png I again get
> a file that is seen as RGB in ImageJ and gives me wrong values. 6) One
> other important point that I discovered in the process: grayscale tif
> files exported from GIMP cannot be opened in ImageJ at all. The
> following error message appears: “TiffDecoder Unsupported
> SamplesPerPixel: 2”. Thus I cannot really work with lossless files
> exported from GIMP (at least not with the two most popular formats).
> The problem is again restricted to grayscale images, color images open
> fine and give correct density values.
Thanks for following up on the thread!

Rob

--
__________________
Robert W. Baer, Ph.D.
Professor of Physiology
Kirksille College of Osteopathic Medicine
A. T. Still University of Health Sciences
Kirksville, MO 63501 USA

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html