Getting Tiff Image Properties

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Freedolen
    New Member
    • Mar 2007
    • 17

    Getting Tiff Image Properties

    Hi,

    Iam new to this forum.
    I need to find the given TIFF image is in CMYK or RGB.

    Though i have checked with Image::Magick, and used:
    Code:
    my $img = new Image::Magick;
    $img->Read("Sample.tif");
    my ($type) = $img->Get("type");
    print $type;
    It displays "TrueColor" and "Palette" for RGB and "ColorSeparatio n" for CMYK
    Is there any specific property or method to find an image which is RGB or CMYK?

    I have found 'colorspace' property ($rgborcmyk = $img->Get('colorspac e'); ), which tells Grayscale pictures also as RGB.

    I have one more doubt also, if iam running this for collection of TIFF images, is there any need to redeclare object every for new image,(my $img = new Image::Magick; ) b'cos iam getting properties of previous image if undeclared every time.

    OS: Windows 2000
    Perl Version: 5.8.3

    Thanks in Advance,
    Freedolen
  • miller
    Recognized Expert Top Contributor
    • Oct 2006
    • 1086

    #2
    Hi Freedolen,

    Image::Magick is the only module that I'm familiar with for such processing. However, I've never tested for that particular attribute before, so I can't tell you if there is a more specific property.

    I would definitely advise you to start with a fresh object for each image that you process. Unless efficiency is truly that large of a concern, there really isn't any other way to be absolutely sure that you won't be getting latent data. So I always start fresh when using any CPAN modules.

    Not overly helpful, I know. But it's all the experience I have with Image::Magick specifically.

    - Miller

    Comment

    Working...