octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Lowering GraphicsMagick/ImageMagick Quantum depth warning


From: Carnë Draug
Subject: Lowering GraphicsMagick/ImageMagick Quantum depth warning
Date: Wed, 18 Nov 2015 01:06:37 +0000

I am planning on changing the current warning about ImageIO being
limited to a specific bitdepth so that it stops warning if we have
at least support for 16 bit images.  I explain my reasoning below
including an explanation what this quantum depth is.

I will push such change later in the week unless someone disagrees.


Octave uses GraphicsMagick or ImageMagick for reading image files.
One issue with it, is that the configure options of GraphicsMagick
will dictate limitations on the support for those files bitdepth.
If GraphicsMagick was built with quantum depth 8 then the values
will always be read as uint8.  If the image was originally 16bit,
there is currently no way to know that GraphicsMagick rescaled the
data down to 8bit.  Because of this, we always give a warning: we
do not know if the image was read correctly or rescaled.

However, the opposite is possible, i.e., if it was built with quantum
depth 16 and an image was 8bit, we do know that rescaled up to the
16bit range.  Octave then rescales it back to 8bit, which is why the
warning is about "being limited to X" and not "always reads X bit
per pixel".

There are 3 possible quantum depth options: 8, 16, and 32.  At the
moment, Octave will warn being limited to a specific quantum depth
unless it was set to 32, only because it was the maximum.  I propose
to change it so it only warns if it was set to below 16 (another
way to see it, is only warn if limited to 8bit).

The reason is that this warning is issued on every Octave session
when one of the image IO functions is called.  For many cases, the
warning is not even necessary as most people will only deal with 8
bit images.  So we are scaring users for no good reason.  But 16bit
images are becoming increasingly common, and have been the norm for
scientific equipment for many years (I may be biased for microscope
cameras).

32 bit images are very rare.  At that point it's more common to have
floating point images.  And GraphicsMagick only supports integers
anyway.  Users that do have such 32bit images, will probably notice
quickly that there was a problem on the reading anyway.

A warning makes sense when we expect something to be wrong.  I don't
think we should expect that the files would be 32 bit, not more than
the alternatives.  And the warning kinda suggests that the user should
be using GraphicsMagick with quantum depth 32 by default (he should not,
that takes crazy amount of memory).

We are currently recommending quantum depth 16 on the wiki [1] and
all of the Linux distributions have bumped the default configure
options to 16.  And 16 bit quantum depth is overall the most sensible
option (see the Debian bug about the subject [2], including the
comment from Bob Friesenhahn, GraphicsMagick maintainer [3]).

Carnë

[1] http://wiki.octave.org/GraphicsMagick
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=557879
[3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=557879#32



reply via email to

[Prev in Thread] Current Thread [Next in Thread]