Login  Register

Re: How are images larger than the display window rendered?

Posted by Michael Schmid on May 31, 2021; 2:17pm
URL: http://imagej.273.s1.nabble.com/How-are-images-larger-than-the-display-window-rendered-tp5024669p5024670.html

Hi Conner,

for displaying large images at zoom levels below 100%, ImageJ uses a
mixture of subsampling (i.e., pixels are omitted) and averaging.
This is actually done by Java, so it may depend on the version of the
Java virtual machine (JVM) that you use. ImageJ just specifies
'RenderingHints.VALUE_RENDER_QUALITY', i.e., Java should optimize for
quality, not speed.

You can check the method by drawing a 1-pixel wide line under a small
angle from horizontal or vertical on a blank image. When the image is
zoomed out, in case of subsampling the line will become a dashed line.

On my machine (Oracle Java 1.8.0_112 on Linux), for zoom levels from 50
to 99%, the displayed image uses averaging, i.e. a black line becomes
gray. At lower zoom levels, a mixture of averaging and subsampling is
used: Averaging of 2x2 pixel blocks and then subsampling. Thus, at 25%
zoom level, the dashes of a black line on white background have a mid
gray level and a "fill factor" of 1/2, i.e., the dashes and spaces have
the same length. At 12.5% the fill factor decreases to 1/4.
(Strictly speaking, since the display is nonlinear, one should not use a
mid gray level like 128 for the average of two pixels with 255 and two
with 0 but take the Gamma value of the display into account. At least my
Java version does not do this.)

---
By the way, for zooming in, there is an option whether to interpolate
(smooth the pixels) in Edit>Options>Appearance.


Michael
________________________________________________________________
On 31.05.21 15:17, Phillips, Conner wrote:

> Greetings,
>
> I am trying to compare a program written in LabVIEW with ImageJ. LabVIEW seems to do something odd when rendering images which are larger than their displaying window. I found an unverified mention that the largest value in a neighborhood is taken when downsizing to fit the image into the window (intensity chart). ImageJ seems to render the same ImageJ just fine though. How does ImageJ decided on the pixel values when resampling a large image to fit into the display window?
>
> Thanks!
>
> --
> Fraunhofer-Institut für Keramische Technologien und Systeme IKTS
> Conner Phillips
> Charakterisierungsverfahren | Characterization Technologies
> Maria-Reiche-Straße 2, 01109 Dresden, Germany
> <https://s.fhg.de/ikts-klotzsche>Telefon +49 351 88815-541
> Fax +49 351 88815-509
> [hidden email]

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