Image::BMP is a bitmap parser/viewer.
SYNOPSIS
use Image::BMP;
# Example one:
my $img = new Image::BMP(
file => 'some.bmp',
debug => 1,
);
$img->view_ascii;
# Example two:
my $img2 = new Image::BMP;
$img2->open_file('another.bmp');
my $color = $img2->xy(100,100); # Get pixel at 100,100
my ($r,$g,$b) = $img2->xy_rgb(100,200);
Image::BMP objects can parse and even ascii view bitmaps of the .BMP format. It can read most of the common forms of this format.
It can be used to:
Just get image info, don't read the whole image:
my $img = new Image::BMP(file => 'some.bmp');
print "Resolution: $img->{Width} x $img->{Height}n";
View images
(See C< SYNOPSIS > example one)
Read images and poke at pixels
(See C< SYNOPSIS > example two)
Parse through all pixel data
(See C< ADD_PIXEL > below)
It does not currently write bmap data, simply because I didn't have a use for that yet. Convince me and I'll add it.
Limitations:
4-bit RLE compression
· I haven't seen an image like this yet, it wouldn't be hard to add.
bitfields compression
· I don't even know what that is..
RLE 'delta' compression
· This isn't tested yet - I haven't seen an image that uses this portion of RLE compression, so it currently does what I think is right and then prints a message asking you to send me the image/results.
Product's homepage
Requirements:
· Perl