The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Image::Placeholder - generate images for use as placeholders

SYNOPSIS

    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();

OPTIONS

The new() method accepts a hash of options to control the size and appearance of the generated image.

background_colour

The colour that the background of the image should be painted. Accepts a colour value (see "Valid colour values"). Defaults to ddd.

font

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.

height

The height of the image in pixels. Defaults to the same as width.

line_colour

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.

size

A text alternative to supplying width and height separately; of the form '300x250'.

text

The text to use across the image. Defaults to the size of the image, expressed in the form '300x250'.

text_colour

The colour that the text should be painted in. Accepts either a colour value or none to suppress the text. Defaults to 36f.

transparent

Makes the background transparent.

width

The width of the image in pixels. Defaults to 300.

Valid colour values

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.

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.

SEE ALSO

placeholder

command-line generator that uses this module.

http://ima.gs/

hosted version of this module.

AUTHOR

Mark Norman Francis, norm@cackhanded.net.

COPYRIGHT AND LICENCE

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.