Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hai monks


How to extract Bit count of an image using perlmagick module


Thanks in advance


Rudhra

Replies are listed 'Best First'.
Re: perlmagick : Image processing
by matija (Priest) on Apr 06, 2004 at 10:52 UTC
    Bit count? I'm not quite sure what you mean. If you mean the file size, the -s operator returns the size of the file.

    If you want to know the number of pixels, you could use Image::Size, then multiply the x and y dimension.

    I couldn't find a module called "perlmagick", but I did find Image::Magick which is the Perl interface to Imagemagick, and which can return various kinds of information about the image if you use the Get method.

Re: perlmagick : Image processing
by nmcfarl (Pilgrim) on Apr 06, 2004 at 15:45 UTC
    The # bits per pixel, or image depth can be gotten by:
    my ($depth)=$image->Get('depth');
      Oops, forgot to mention that this report color depth per RGB component, per pixel. So a depth of 8, times the 3 RGB components is a "24 bit image"