By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,365 Members | 1,390 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,365 IT Pros & Developers. It's quick & easy.

Getting Tiff Image Properties

P: 17
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:
Expand|Select|Wrap|Line Numbers
  1. my $img = new Image::Magick;
  2. $img->Read("Sample.tif");
  3. my ($type) = $img->Get("type");
  4. print $type;
  5.  
It displays "TrueColor" and "Palette" for RGB and "ColorSeparation" 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('colorspace'); ), 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
Mar 20 '07 #1
Share this Question
Share on Google+
1 Reply


miller
Expert 100+
P: 1,089
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
Mar 20 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.