Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Open Source > Perl
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Perl section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 13th, 2007, 08:11 AM
Registered User
 
Join Date: Feb 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Working with TIFF images

Hi,

Is it possible to find whether a Tiff image is RGB or CMYK using perl?

Regards,
Freedolen
 
Old March 13th, 2007, 10:37 PM
Registered User
 
Join Date: Feb 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Though i have checked with
Image::Magick;
and used
my $img = new Image::Magick;
$img->Read("Sample.tif");
my ($type) = $img->Get("type");
print $type;
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?

Regards,
Freedolen
 
Old March 14th, 2007, 10:41 PM
Registered User
 
Join Date: Feb 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

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

Regards,
Freedolen

 
Old March 16th, 2007, 10:55 AM
Friend of Wrox
 
Join Date: Jan 2005
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

Glad you got it sorted out. here's some example usage of the Image::Magick function.
it's not that new v6!!
Code:
use Image::Magick;
$p = new Image::Magick;
$p->Read("imagefile");
$p->Set(attribute => value, ...)
($a, ...) = $p->Get("attribute", ...)
$p->routine(parameter => value, ...)
$p->Mogrify("Routine", parameter => value, ...)
$p->Write("filename");

www.crmpicco.co.uk
www.ie7.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Arch and Design : Involving Tiff images navdeep General .NET 2 July 17th, 2007 05:50 AM
Php code to put&get images from mysql not working! angelbeans PHP Databases 1 September 8th, 2006 12:44 PM
Problem while handling Tiff Images singhmanpreet C# 0 June 29th, 2005 05:53 AM
Working with Images Issue Capt D PHP Databases 6 January 31st, 2005 04:49 PM
Working with images Pallav Servlets 6 September 24th, 2004 12:51 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.