Image::Placeholder - generate images for use as placeholders
use Image::Placeholder; my $image = Image::Placeholder->new( width => 300, height => 250, background_colour => 'ccc', line_colour => 'none', font => 'Gill Sans', text => 'IAB MRec', ); print $image->generate();
The new() method accepts a hash of options to control the size and appearance of the generated image.
The colour that the background of the image should be painted. Accepts a colour value (see "Valid colour values"). Defaults to ddd.
The font to use for the text in the image. Requires fontconfig support in your GD library. Defaults to Museo Sans, which is available free from http://www.josbuivenga.demon.nl/museosans.html.
The height of the image in pixels. Defaults to the same as width.
width
The colour that the border and cross lines should be painted in. Accepts either a colour value or none to suppress them. Defaults to 444.
none
A text alternative to supplying width and height separately; of the form '300x250'.
height
The text to use across the image. Defaults to the size of the image, expressed in the form '300x250'.
The colour that the text should be painted in. Accepts either a colour value or none to suppress the text. Defaults to 36f.
Makes the background transparent.
The width of the image in pixels. Defaults to 300.
Colour values are specified as the red, green and blue channels in hexadecimal, where 00 is the least and FF is the most. So black is 000000 and white is FFFFFF.
00
FF
000000
FFFFFF
CSS-style 3-character shorthand is also accepted where the three channels are repeating characters. So black is also 000 and white FFF. All three values have to be repeating, so a value such as 080808 cannot be shorted.
000
FFF
080808
command-line generator that uses this module.
hosted version of this module.
Mark Norman Francis, norm@cackhanded.net.
Copyright 2010 Mark Norman Francis.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Image::Placeholder, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Image::Placeholder
CPAN shell
perl -MCPAN -e shell install Image::Placeholder
For more information on module installation, please visit the detailed CPAN module installation guide.