Lowering GraphicsMagick/ImageMagick Quantum depth warning

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Lowering GraphicsMagick/ImageMagick Quantum depth warning

Carnë Draug
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 | Threaded
Open this post in threaded view
|

Re: Lowering GraphicsMagick/ImageMagick Quantum depth warning

Mike Miller-4
On Wed, Nov 18, 2015 at 01:06:37 +0000, Carnë Draug wrote:
> I will push such change later in the week unless someone disagrees.

LGTM!

--
mike

Reply | Threaded
Open this post in threaded view
|

Re: Lowering GraphicsMagick/ImageMagick Quantum depth warning

chechu
In reply to this post by Carnë Draug

For us it seems also a good decision.
Thanks

Reply | Threaded
Open this post in threaded view
|

Re: Lowering GraphicsMagick/ImageMagick Quantum depth warning

Carnë Draug
On 18 November 2015 at 01:06, Carnë Draug <[hidden email]> wrote:
> 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.

On 18 November 2015 at 03:39, Mike Miller <[hidden email]> wrote:
> LGTM!

On 18 November 2015 at 07:02, Chechu Garguez <[hidden email]> wrote:
> For us it seems also a good decision.

Done http://hg.savannah.gnu.org/hgweb/octave/rev/131b4af8b5d8

Reply | Threaded
Open this post in threaded view
|

Re: Lowering GraphicsMagick/ImageMagick Quantum depth warning

tmacchant
On octave for windows 4.0.1 built using mxe-octave.

>> test imfinfo verbose
 :
 :
 :
warning: your version of GraphicsMagick limits images to 8 bits per pixel

Looking into graphickmagick.mk, I cannot find to specify quantum depth.
Therefore the warning the above appeared.

Why graphickmagick is not built with 16 bit quantum depth in mxe-octave?

Tatsuro
Reply | Threaded
Open this post in threaded view
|

Re: Lowering GraphicsMagick/ImageMagick Quantum depth warning

John Donoghue-3
On 03/30/2016 04:52 AM, tmacchant [via Octave] wrote:
On octave for windows 4.0.1 built using mxe-octave.

>> test imfinfo verbose
 :
 :
 :
warning: your version of GraphicsMagick limits images to 8 bits per pixel

Looking into graphickmagick.mk, I cannot find to specify quantum depth.
Therefore the warning the above appeared.

Why graphickmagick is not built with 16 bit quantum depth in mxe-octave?

Tatsuro


If you reply to this email, your message will be added to the discussion below:
http://octave.1599824.n4.nabble.com/Lowering-GraphicsMagick-ImageMagick-Quantum-depth-warning-tp4673547p4675987.html
This email was sent by tmacchant (via Nabble)
To receive all replies by email, subscribe to this discussion

There is a bug report [1] about it, with patch - it had been decided not to use it until after 4.0.1. Last time I tried it, it also caused random failures in the tests


[1] https://savannah.gnu.org/bugs/?func=detailitem&item_id=43505


Reply | Threaded
Open this post in threaded view
|

Re: Re: Lowering GraphicsMagick/ImageMagick Quantum depth warning

tmacchant
In reply to this post by Carnë Draug
--- john.david.donoghue

> On 03/30/2016 04:52 AM, tmacchant [viaOctave] wrote:
> On octave for windows 4.0.1 built using mxe-octave.
>
> >> test imfinfo verbose
> :
> :
> :
> warning: your version of GraphicsMagick limits images to 8 bitsper pixel
>
> Looking into graphickmagick.mk, I cannot find to specify quantumdepth.
> Therefore the warning the above appeared.
>
> Why graphickmagick is not built with 16 bit quantum depth inmxe-octave?
>
> Tatsuro
>
> If you reply to this email, yourmessage will be added to the discussion below:
> http://octave.1599824.n4.nabble.com/Lowering-GraphicsMagick-ImageMagick-Quantum-depth-warning-tp4673547p4675987.htmlThis email was sent by tmacchant(via Nabble)
> To receive all replies by email, subscribeto this discussion
>
> There is a bug report [1] about it, with patch - it had been decidednot to use it until after 4.0.1. Last time I tried it, it alsocaused random failures in the tests
>
>
> [1] https://savannah.gnu.org/bugs/?func=detailitem&item_id=43505
>
I understand the situation.
It seems that there are complicated relationship to the Java.
I hope the issue will be solved in the near future.

Thanks.  

Tatsuro

Reply | Threaded
Open this post in threaded view
|

Re: Re: Lowering GraphicsMagick/ImageMagick Quantum depth warning

tmacchant
> From: "tmacchant
> To: John Donoghue ; Octave Maintainers List > Cc: 
> Date: 2016/3/30, Wed 20:12
> Subject: Re: Re: Lowering GraphicsMagick/ImageMagick Quantum depth warning
>
> --- john.david.donoghue
>>  On 03/30/2016 04:52 AM, tmacchant [viaOctave] wrote:
>>  On octave for windows 4.0.1 built using mxe-octave.
>>
>>  >> test imfinfo verbose
>>  :
>>  :
>>  :
>>  warning: your version of GraphicsMagick limits images to 8 bitsper pixel
>>
>>  Looking into graphickmagick.mk, I cannot find to specify quantumdepth.
>>  Therefore the warning the above appeared.
>>
>>  Why graphickmagick is not built with 16 bit quantum depth inmxe-octave?
>>
>>  Tatsuro
>>
>>  If you reply to this email, yourmessage will be added to the discussion
> below:
>>
> http://octave.1599824.n4.nabble.com/Lowering-GraphicsMagick-ImageMagick-Quantum-depth-warning-tp4673547p4675987.htmlThis 
> email was sent by tmacchant(via Nabble)
>>  To receive all replies by email, subscribeto this discussion
>>
>>  There is a bug report [1] about it, with patch - it had been decided not to
> use it until after 4.0.1. Last time I tried it, it also caused random failures in
> the tests
>>
>>
>>  [1] https://savannah.gnu.org/bugs/?func=detailitem&item_id=43505
>>
> I understand the situation.
> It seems that there are complicated relationship to the Java.
> I hope the issue will be solved in the near future.



I found that GraphicsMagick is configured --with-quantum-depth=16 in current mxe-octave.

Is the problem solved?

Tatsuro

Reply | Threaded
Open this post in threaded view
|

Re: Re: Lowering GraphicsMagick/ImageMagick Quantum depth warning

Carnë Draug
On 6 July 2016 at 06:04, Tatsuro MATSUOKA <[hidden email]> wrote:

>> From: "tmacchant
>> To: John Donoghue ; Octave Maintainers List > Cc:
>> Date: 2016/3/30, Wed 20:12
>> Subject: Re: Re: Lowering GraphicsMagick/ImageMagick Quantum depth warning
>>
>> --- john.david.donoghue
>>>  On 03/30/2016 04:52 AM, tmacchant [viaOctave] wrote:
>>>  On octave for windows 4.0.1 built using mxe-octave.
>>>
>>>  >> test imfinfo verbose
>>>  :
>>>  :
>>>  :
>>>  warning: your version of GraphicsMagick limits images to 8 bitsper pixel
>>>
>>>  Looking into graphickmagick.mk, I cannot find to specify quantumdepth.
>>>  Therefore the warning the above appeared.
>>>
>>>  Why graphickmagick is not built with 16 bit quantum depth inmxe-octave?
>>>
>>>  Tatsuro
>>>
>>>  If you reply to this email, yourmessage will be added to the discussion
>> below:
>>>
>> http://octave.1599824.n4.nabble.com/Lowering-GraphicsMagick-ImageMagick-Quantum-depth-warning-tp4673547p4675987.htmlThis
>> email was sent by tmacchant(via Nabble)
>>>  To receive all replies by email, subscribeto this discussion
>>>
>>>  There is a bug report [1] about it, with patch - it had been decided not to
>> use it until after 4.0.1. Last time I tried it, it also caused random failures in
>> the tests
>>>
>>>
>>>  [1] https://savannah.gnu.org/bugs/?func=detailitem&item_id=43505
>>>
>> I understand the situation.
>> It seems that there are complicated relationship to the Java.
>> I hope the issue will be solved in the near future.
>
>
>
> I found that GraphicsMagick is configured --with-quantum-depth=16 in current mxe-octave.
>
> Is the problem solved?
>

Yes https://savannah.gnu.org/bugs/?43505

Reply | Threaded
Open this post in threaded view
|

Re: Re: Lowering GraphicsMagick/ImageMagick Quantum depth warning

tmacchant
In reply to this post by Carnë Draug


--- carandraug

> On 6 July 2016 at 06:04, Tatsuro MATSUOKA wrote:
> >> From: "tmacchant
> >> To: John Donoghue ; Octave Maintainers List > Cc:
> >> Date: 2016/3/30, Wed 20:12
> >> Subject: Re: Re: Lowering GraphicsMagick/ImageMagick Quantum depth warning
> >>
> >> --- john.david.donoghue
> >>>  On 03/30/2016 04:52 AM, tmacchant [viaOctave] wrote:
> >>>  On octave for windows 4.0.1 built using mxe-octave.
> >>>
> >>>  >> test imfinfo verbose
> >>>  :
> >>>  :
> >>>  :
> >>>  warning: your version of GraphicsMagick limits images to 8 bitsper pixel
> >>>
> >>>  Looking into graphickmagick.mk, I cannot find to specify quantumdepth.
> >>>  Therefore the warning the above appeared.
> >>>
> >>>  Why graphickmagick is not built with 16 bit quantum depth inmxe-octave?
> >>>
> >>>  Tatsuro
> >>>
> >>>  If you reply to this email, yourmessage will be added to the discussion
> >> below:
> >>>
> >> http://octave.1599824.n4.nabble.com/Lowering-GraphicsMagick-ImageMagick-Quantum-depth-warning-tp4673547p4675987.htmlThis
> >> email was sent by tmacchant(via Nabble)
> >>>  To receive all replies by email, subscribeto this discussion
> >>>
> >>>  There is a bug report [1] about it, with patch - it had been decided not to
> >> use it until after 4.0.1. Last time I tried it, it also caused random failures in
> >> the tests
> >>>
> >>>
> >>>  [1] https://savannah.gnu.org/bugs/?func=detailitem&item_id=43505
> >>>
> >> I understand the situation.
> >> It seems that there are complicated relationship to the Java.
> >> I hope the issue will be solved in the near future.
> >
> >
> >
> > I found that GraphicsMagick is configured --with-quantum-depth=16 in current mxe-octave.
> >
> > Is the problem solved?
> >
>
> Yes https://savannah.gnu.org/bugs/?43505

Thanks for your reply.