Wrong depth?
Posted: 2014-09-23T08:45:26-07:00
Hi,
I've been practicing with Magick++ for some time. And can't understand one simple thing.
I want to get the depth (bits per pixel) of an image. In this simple case I expected a simple solution, like .depth() method of Image class.
But the thing is the method is wrong on some images.
For example if you test the images from wikipedia article about color depth http://en.wikipedia.org/wiki/Color_depth
you'll get some weird results: depth is always the same. It's 8.
Also I've found .modulusDepth() method. It's right sometimes:
1_bit.png : modulusDepth = 1
2_bit.png : modulusDepth = 2
4_bit.png : modulusDepth = 8
8_bit.png : modulusDepth = 8
true_color(24_bits).png : modulusDepth = 8
After hours of googling the answer I gave up and came here.
I suppose I'm under a delusion and don't get something about images in general.
I hope you'll help me.
Thank you for your patience after this noob question.
I've been practicing with Magick++ for some time. And can't understand one simple thing.
I want to get the depth (bits per pixel) of an image. In this simple case I expected a simple solution, like .depth() method of Image class.
But the thing is the method is wrong on some images.
For example if you test the images from wikipedia article about color depth http://en.wikipedia.org/wiki/Color_depth
you'll get some weird results: depth is always the same. It's 8.
Also I've found .modulusDepth() method. It's right sometimes:
1_bit.png : modulusDepth = 1
2_bit.png : modulusDepth = 2
4_bit.png : modulusDepth = 8
8_bit.png : modulusDepth = 8
true_color(24_bits).png : modulusDepth = 8
After hours of googling the answer I gave up and came here.
I suppose I'm under a delusion and don't get something about images in general.
I hope you'll help me.
Thank you for your patience after this noob question.