Performance of MagickGetImageDepth ... huh?

The MagickWand interface is a new high-level C API interface to ImageMagick core methods. We discourage the use of the core methods and encourage the use of this API instead. Post MagickWand questions, bug reports, and suggestions to this forum.
Post Reply
paraplegic

Performance of MagickGetImageDepth ... huh?

Post by paraplegic »

I posted earlier about a 6.3.9 performance regression, and I think I've tracked the glitch down to MagickGetImageDepth, which seems to take quite a while to execute, at least compared to MagickGetImageHeight/Width. Has anyone noticed a problem with this? I'm running the latest stable 6.4.0,3 from svn on FreeBSD 6.3-R using gcc. Is this a problem, or does the algorithm to determine depth take some gyrations which I hadn't expected (eg: return the Quantum size??).
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Performance of MagickGetImageDepth ... huh?

Post by magick »

MagickGetImageDepth() inspects each pixel of the image to determine its actual bit depth. It is optimized to return quickly if the image is colormapped or if the depth matches the quantum depth (e.g. a 16-bit image and a Q16 version of ImageMagick). At some point we discussed adding a new method that just returns the image->depth member but have not implemented it just yet.
paraplegic

Re: Performance of MagickGetImageDepth ... huh?

Post by paraplegic »

magick wrote:MagickGetImageDepth() inspects each pixel of the image to determine its actual bit depth. It is optimized to return quickly if the image is colormapped or if the depth matches the quantum depth (e.g. a 16-bit image and a Q16 version of ImageMagick). At some point we discussed adding a new method that just returns the image->depth member but have not implemented it just yet.
I will code some sort of work around ... thanks very much for the explanation, it is much appreciated.

Cheers,
Rob.
Post Reply