Download Imager Cookbook - Imager Cookbook Description, Imager Cookbook Reviews
Contact
 


 

Download

 
Download Now
Perl Artistic License
Downloads till now: 4
 
 

Quick search

 



 

Rate this software

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

No. Votes

0

 

Linux

Assembler Tools , Bug Tracking , Code Generators , Compilers , Debuggers , Disassemblers , Internationalization , Interpreters , Libraries , Localization, Perl Modules , Preprocessors , Quality Assurance and Testing , UI (User Interfaces) , Version Control , Widgets ,

Windows

Mac

Mobile

Drivers

Scripts - DHTML

Scripts - DHTML (new)

Web Developer Blog

Web Developer Blog (new)

Scripts and Applications

Ajax
ASP
ASP.NET
C and C++
CFML
CGI and Perl
Flash
Java
JavaScript
PHP
Python
XML

Imager Cookbook

 

Details

Last Update: 2008-01-15 17:01:12
Version: Imager::Cookbook
License/Program Type: Perl Artistic License
Publisher: Tony Cook
Price:$0.00
Description:

Imager::Cookbook contains recipes for working with Imager.
FILES
This is described in detail in Imager::Files.
Reading an image from a file
my $image = Imager->new;
$image->read(file=>$filename) or die $image->errstr;
See Imager::Files.
Writing an image to a file
$image->write(file=>$filename) or die $image->errstr;
Write an animated gif.
build an array of images to use in the gif
my @images;
synthesize the images or read them from files, it doesn't matter
...
write the gif
Imager->write_multi({ file=>$filename, type=>'gif' }, @images)
or die Imager->errstr;
See "Writing an animated GIF" in Imager::Files for a more detailed example.
Reading multiple images from one file
Some formats, like GIF and TIFF support multiple images per file. Use the read_multi() method to read them:
my @images = Imager->read_multi(file=>$filename)
or die Imager->errstr;
Converting from one file format to another
This is as simple as reading the original file and writing the new file, for single images:
my $image = Imager->new;
Imager auto-detects the input file type
$image->read(file => $input_filename)
or die $image->errstr;
Imager derives the output file format from the filename
$image->write(file => $output_filename)
or die $image->errstr;
or you can supply a type parameter:
$image->write(file => $output_filename, type => 'gif')
or die $image->errstr;
The main issue that can occur with this is if the input file has transparency and the output file format doesn't support that. This can be a problem when converting from GIFs to JPEGs for example.
To work around that you can compose the source image onto a background color:
if ($image->getchannels == 4 or $image->getchannels == 2) {
my $back = Imager->new(xsize => $image->getwidth,
ysize => $image->getheight);
grey background for grayscale images, red for color
my $back_color = $image->getchannels == 2 ? [ 128 ] : 'red';
$back->box(filled => 1, color => $back_color);
$back->rubthrough(src => $image);
$image = $back;
}
now we can write safely to jpeg or pnm
Some formats support multiple files, so if you want to convert from say tiff to jpeg, you'll need multiple output files:
my @images = Imager->read_multi(file => 'input.tif')
or die Imager->errstr;
my $index = 1;
for my $image (@images) {
$image->write(file => sprintf('output%02d.jpg', $index++))
or die $image->errstr;
}
Requirements:
· Perl



Leave a comment




(optional)

What is 7-3?




0 comments


Add to

 Del.icio.us   Digg It   Furl   YahooMyWeb   Blinklist
 

Imager Cookbook Version History

Product Date Added
Imager Cookbook Imager::Cookbook 2008-01-15 17:01:12


Related Software

core2
From category: Libraries
core2 1.0.1 is libraries software developed by Zwetan Kjukov. core2 project is a library that extends the ECMAScript built-in objects: Array, Boolean, Date, Error, Function, Number, Object, and Str...
AxKit2::Plugin 1.1
From category: Libraries
AxKit2::Plugin 1.1 is libraries software developed by AxKit2::Plugin Team. AxKit2::Plugin is a base class for all plugins. An AxKit2 plugin allows you to hook into various parts of processin...
TuxCap
From category: Libraries
TuxCap is game framework software....
ArrowHead ASP Server 0.2.3
From category: Interpreters
ArrowHead ASP Server 0.2.3 is interpreters software developed by Lazerdye. ArrowHead ASP Server is a Java Servlet which supports the ASP syntax and the VBScript programming language. It aims to sup...
Bio::PrimarySeqI
From category: Libraries
Bio::PrimarySeqI 1.4 is libraries software developed by Ewan Birney. Bio::PrimarySeqI is a Perl Interface definition for a Bio::PrimarySeq. SYNOPSIS Bio::PrimarySeqI is the inte...
UCommon
From category: Libraries
UCommon is a lightweight C++ library to facilitate using C++ design patterns....
Class::XML
From category: Libraries
Class::XML 0.06 is libraries software developed by Matt S Trout. Class::XML is a Perl module for simple XML Abstraction. SYNOPSIS package Foo; use base qw/Class::XML/; \...
Bigtop::Docs::TentTut
From category: Libraries
Bigtop::Docs::TentTut 0.14 is libraries software developed by Phil Crow. Bigtop::Docs::TentTut is Perl module for tentmaker Tutorial (best viewed in html). If you don\'t know what Bigtop is,...
ASNMTAP::Asnmtap::Plugins::Nagios 3.000.010
From category: Libraries
ASNMTAP::Asnmtap::Plugins::Nagios 3.000.010 is libraries software developed by Alex Peeters. ASNMTAP::Asnmtap::Plugins::Nagios provides a nice object oriented interface for building Nagios compatib...
Ant SVK Task 0.0.10
From category: Version-Control
Ant SVK Task 0.0.10 is version control software developed by Ant SVK Task Team. Ant SVK Task is a software that can create fully functional support for the SVK SCM tool within Ant build files. \...
Datamixer
From category: Quality-Assurance-and-Testing
Datamixer 0.1.88 is quality assurance and testing software developed by Rick Wood. How do you build a web application without data? Suppose it has many pages, including forms and pages for display....
Bio::Root::Object
From category: Libraries
Bio::Root::Object 1.4 is libraries software developed by Bio::Root::Object Team. Bio::Root::Object is a core Perl 5 object. SYNOPSIS Use this module as the root of your inheritanc...
DateTime::Format::Epoch::DotNet
From category: Libraries
DateTime::Format::Epoch::DotNet 0.10 is libraries software developed by Eugene van der Pijli. DateTime::Format::Epoch::DotNet is a Perl module that can convert DateTimes to/from .NET epoch seconds....
Pod Tidy
From category: Perl-Modules
Pod::Tidy is a reformatting Pod processor....
CLIP
From category: Preprocessors
CLIP 1.2.0 is preprocessors software developed by ITK. CLIP is a Clipper/XBase compatible compiler with initial support other xBase dialects. CLIP project features support for international languag...
 

Top Downloads

 
1. Canon PIXMA iP1000 Printer Driver
2. Canon PIXMA iP1200 Printer Driver
3. Realtek RTL8139C(L)+/RTL8139D(L)/RTL8100(L)/RTL8130/RTL8139B(L) Driver
4. Realtek ALC/ 262/ 265/ 268/ 660/ 861/ 880/ 882/ 883/ 885/ 888 Audio
5. Canon PIXMA iP1300 Printer Driver c
6. Canon PIXMA iP1600 Printer Driver
7. Canon i-SENSYS LBP2900 Printer Driver R
8. Canon PIXMA MP160 MP Drivers 9xME
9. Canon PIXMA iP1200 Printer Driver x64 d
10. Canon PIXMA MP210 MP Drivers
11. Canon LaserShot LBP-1210 Printer Driver
12. Mercury P4VM800M7
13. Realtek RTL8100B(L)/RTL8100C(L)/RTL8101L/RTL8139C(L) Driver XP
14. Canon PIXMA iP1300 Printer Driver a
15. Canon i560 Printer Driver
16. SendSong
17. Canon PIXMA MP160 MP Drivers xp64
18. iBlackjack
19. Asus EZVcr II
20. LG GSA-2166D

DownloadTube Editor Reviews

 
1. ViewonLog for Visual Studio 2005 SP1
ViewonLog is a real-time logging solution that checks the pr...
2. Free Registry Accelerator
Free Registry Accelerator - a tool to clean, repair and opti...
3. Magic 3GP Video Converter
Magic 3GP Video Converter is a professional 3GP converter th...
4. Cool Music CD Burner
Cool Music CD Burner lets you easily burn your favorite MP3 ...
5. Intertech DVD to 3GP Converter
Intertech DVD to 3GP Converter is an extremely easy to use D...
6. Media Encoder Console
Media Encoder Console allows you convert any video to most o...
7. Wavosaur free wav editor
Wavosaur is a portable digital audio editing software which ...
8. BatchPhoto Lite
With BatchPhoto you will be able to easily resize and rename...
9. OrgScheduler
OrgScheduler is a universal scheduler for individual/busines...
10. AlwaysUp
AlwaysUp is a truly impressive software that runs your appli...

Software Reviews Full List



Recent Blog Posts

 
1. Some Little, Nice, Freeware Tools You May Never Know When You'll Need
This time I won’t speak about a single freeware program that...
2. How To Increase The Quality of Your News Articles For Search Engine Spiders
The process of articles publishing is a common practice to...
3. Digg in Press: Tips and Opinions
Regarding Digg social bookmarking service there are many a...
4. Ubuntu Linux and Windows Can Share The Desktop In Absence Of Virtual Machines
Many people asked themselves how to run Ubuntu Linux and W...
5. 2.5 Millions Downloads for FireTune: It Makes Mozilla Firefox To Run With The Speed of Light
It is well known the fact that even the latest version of M...
6. Image Galleries on Autopilot: Instant Gallery Maker
The creation of image galleries ready for web publishing...
7. Hamad Darwish's Windows Vista Desktop Wallpaper Pack
We came across a great desktop wallpaper pack and an interes...
8. Trick Your Friends Into Shutting Down Their Windows
There are quite many ways to shut down a Windows based syste...
9. Get The Best Freeware Tools For Windows To Optimize RAM Consumption
Depending on the Windows operating system version you may ...
10. Squish Provides Support For Web Applications Running in Firefox 3.0
froglogic GmbH recently announced (2008-08-12) the availab...

Last 20 Scripts

 
1. WordPress CMS
WordPress is a state-of-the-art publishing platform with a f
2. BIGACE
BIGACE is a dynamic PHP and MySQL based Web CMS. It is a mul
3. CMSMS ( CMS Made Simple)
CMS Made Simple is an open source (GPL) package, built using
4. ThimbleDoc
ThimbleDoc is a PHP documentor project. It is simple, straig
5. WESPA PHP Newsletter
WESPA PHP Newsletter script allows you to manage a mailing l
6. Flatchat
Flatchat is a PHP based chat room application that does not
7. Ninja Designs Mailist
Mailist is a PHP based subscription mailing list. A stylish
8. Ninja Blog
Ninja Blog is a PHP based blogging solution. Based upon word
9. SupaBundles Display Your Stats PHP Script
upaBundles Display Your Stats PHP Script allows you to displ
10. Ajax Portal v 2.0
AjaxPortal is a portal script based on Sajax technology for
11. VisualEffectFlag
aipflag is an animation button applet that takes one input f
12. Javascript chronometer/stopwatch
I needed a javascript chronometer/stopwatch to be inserted i
13. HYIPBeings HYIP and Autosurf Lister
his script allows you to create easily and quickly your own
14. Highlighter Component
Highlighter is .NET component that changes format of wanted
15. Gallery-Maker
The gallery maker script is a tool for adult webmasters to a
16. Simple Template System
This is a basic template system that allows you to create a
17. Dodos Image Sort Script
This script makes sorting images based on their width or hei
18. Check Form
Check Form is a form validation script that checks if all fi
19. phpDB
phpDB is a php database abstraction class which is extendabl
20. EMC Base Logger
EMC Base Logger in a Powerful IP Logging / Banning tool. Thi