Image::Info::ASCII - ASCII support for Image::Info


Image::Info::ASCII - ASCII support for Image::Info


 use Image::Info qw(image_info dim);
 my $info = image_info("image.txt");
 if (my $error = $info->{error}) {
     die "Can't parse image info: $error\n";
 my $color = $info->{color_type};
 my($w, $h) = dim($info);


This modules supplies the standard key names except for Compression, Gamma, Interlace, LastModificationTime, as well as:

Reference to an array of all colors used. This key is only present if image_info is invoked as image_info({ColorPalette=>1}).

The number of colors the image uses.

Reference to an array representing a one dimensioanl luminance histogram. This key is only present if image_info is invoked as image_info($file, L1D_Histogram=>1). The range is from 0 to 127, however auto-vivification is used so a null field is also 0, and the array may not actually contain 127 fields. The index in the array corresponds to the ord of the character and thusly fields 0-8,11,12,14-31 should always be blank.

While not immediately obvious, this could be used to accquire information about a normal text file and it's language. Though it would likely have to be English, Hawaiian, Swahili, or Latin (unless you can be assured that no 8th bit characters occur in the first 32 bytes of the source).


the Image::Info manpage, ascii,


For more information about ASCII art see:



Other than being completely functional yet potentially useless?


Jerrad Pierce <>/

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

 Image::Info::ASCII - ASCII support for Image::Info