[prev in list] [next in list] [prev in thread] [next in thread] 

List:       graphicsmagick-help
Subject:    Re: [GM-help] modulusDepth() limited by quantum depth?
From:       Bob Friesenhahn <bfriesen () simple ! dallas ! tx ! us>
Date:       2010-09-02 15:12:24
Message-ID: alpine.GSO.2.01.1009021003350.12887 () freddy ! simplesystems ! org
[Download RAW message or body]

On Wed, 1 Sep 2010, graphicsmagick.yardleydobon@recursor.net wrote:

> I'm using GraphicsMagick 1.3.12 with Q8. I'm working with a 16 bit 
> image with a maximum value of 1023. When I call modulusDepth() on 
> this image it returns 8. Is the maximum value that will be returned 
> from modulusDepth() limited by the quantum depth? Is there a way in 
> gm to determine that 10 bits are needed to hold this image's pixel 
> values without loss?

It is true that the result reflect the image loaded into memory, which 
will be limited to 8 for a Q8 build.  With a Q16 build, you can obtain 
results as high as 16.  There is currently no way to obtain 
information on the original depth and encoding of the image file. 
Please keep in mind that the modulus depth represents a sort of binary 
precision value so that if there is a maximum possible value of 1023, 
it is possible that a full 10 bits are required, but perhaps only one 
bit is necessary (for a black/white bilevel image).  Some file formats 
use alternate encodings such as floating point, or special logarithmic 
encodings but GM only supports simple integer in memory.

> These results don't agree with this description of modulsDepth().
> http://www.graphicsmagick.org/Magick++/Image.html#modulusdepth

The description seems correct to me as long as it is understood that 
all operations apply to the image which was loaded rather than whever 
was contained in the file.

Bob
-- 
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Graphicsmagick-help mailing list
Graphicsmagick-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/graphicsmagick-help
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic