{
    "mode": "perldoc",
    "parameter": "Image::Info::XPM",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Image%3A%3AInfo%3A%3AXPM/json",
    "generated": "2026-06-10T18:18:20Z",
    "synopsis": "use Image::Info qw(imageinfo dim);\nmy $info = imageinfo(\"image.xpm\");\nif (my $error = $info->{error}) {\ndie \"Can't parse image info: $error\\n\";\n}\nmy $color = $info->{colortype};\nmy($w, $h) = dim($info);",
    "sections": {
        "NAME": {
            "content": "Image::Info::XPM - XPM support for Image::Info\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Image::Info qw(imageinfo dim);\n\nmy $info = imageinfo(\"image.xpm\");\nif (my $error = $info->{error}) {\ndie \"Can't parse image info: $error\\n\";\n}\nmy $color = $info->{colortype};\n\nmy($w, $h) = dim($info);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This modules supplies the standard key names except for Compression, Gamma, Interlace,\nLastModificationTime, as well as:\n\nColorPalette\nReference to an array of all colors used. This key is only present if \"imageinfo\" is\ninvoked as \"imageinfo($file, ColorPalette>=1)\".\n\nColorTableSize\nThe number of colors the image uses.\n\nHotSpotX\nThe x-coord of the image's hotspot. Set to -1 if there is no hotspot.\n\nHotSpotY\nThe y-coord of the image's hotspot. Set to -1 if there is no hotspot.\n\nL1DHistogram\nReference to an array representing a one dimensional luminance histogram. This key is only\npresent if \"imageinfo\" is invoked as \"imageinfo($file, L1DHistogram=>1)\". The range is\nfrom 0 to 255, however auto-vivification is used so a null field is also 0, and the array\nmay not actually contain 255 fields.\n\nXPMCharactersPerPixel\nThis is typically 1 or 2. See Image::Xpm.\n\nXPMExtension-.*\nXPM Extensions (the most common is XPMEXT) if present.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "processfile()\n$info->processfile($source, $options);\n\nProcesses one file and sets the found info fields in the $info object.\n",
            "subsections": []
        },
        "FILES": {
            "content": "This module requires Image::Xpm\n\n*$Image::Info::XPM::RGBLIB* is set to /usr/X11R6/lib/X11/rgb.txt or an equivalent path (see the\n\"getrgbtxt\" function for the complete list) by default, this is used to resolve textual color\nnames to their RGB counterparts.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Image::Info, Image::Xpm\n",
            "subsections": []
        },
        "NOTES": {
            "content": "For more information about XPM see <ftp://ftp.x.org/contrib/libraries/xpm-README.html>\n",
            "subsections": []
        },
        "CAVEATS": {
            "content": "While the module attempts to be as robust as possible, it may not recognize older XPMs (Versions\n1-3), if this is the case try inserting /* XPM */ as the first line.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Jerrad Pierce <belg4mit@mit.edu>/<webmaster@pthbb.org>\n\nTels - (c) 2006.\n\nNow maintained by Slaven Rezic <srezic@cpan.org>.\n\nThis library is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
            "subsections": []
        }
    },
    "summary": "Image::Info::XPM - XPM support for Image::Info",
    "flags": [],
    "examples": [],
    "see_also": []
}