{
    "mode": "man",
    "parameter": "jpeg2ktopam",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/jpeg2ktopam/1/json",
    "generated": "2026-08-08T17:40:07Z",
    "synopsis": "jpeg2ktopam [-verbose] [-debuglevel=number] filename",
    "sections": {
        "NAME": {
            "content": "jpeg2ktopam - convert JPEG-2000 code stream to PAM/PNM\n\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "jpeg2ktopam [-verbose] [-debuglevel=number] filename\n\n",
            "subsections": []
        },
        "OPTION USAGE": {
            "content": "Minimum  unique  abbreviation of option is acceptable.  You may use double hyphens instead of\nsingle hyphen to denote options.  You may use white space in place of the equals sign to sep‐\narate an option name from its value.\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This program is part of Netpbm(1).\n\njpeg2ktopam converts the named JPEG-2000 file (JP2 or JPC), or Standard Input if no  file  is\nnamed, to a PBM, PGM, PPM, or PAM file on Standard Output.\n\nThe  JPEG-2000  specification  specifies two different formats: JP2 and JPEG-2000 code stream\n(JPC).  JP2 represents a visual image quite specifically, whereas JPC is a more or less arbi‐\ntrary array of codes.  A JP2 image contains a JPC stream and  metadata  describing  how  that\nstream represents a visual image.  jpeg2ktopam converts both.\n\nIf the color space identified in the image is grayscale (JASIMAGECSGRAY), jpeg2ktopam gen‐\nerates  a  PGM  image,  unless  the  image  contains  only  one  bit per pixel, in which case\njpeg2ktopam generates PBM.  If the color space is RGB (JASIMAGECSRGB), jpeg2ktopam  gener‐\nates  a  PPM  image.   If the input image is anything else, jpeg2ktopam generates a PAM image\nwith no tuple type identified.\n\nIn the PGM and PPM cases, jpeg2ktopam assumes the intensity values in the  input  image  have\nthe  same  meaning  as  for  PGM and PPM.  One thing that implies is the ITU-R Recommendation\nBT.709 color space, which means the assumption is false for JP2 input.  JP2 input  uses  SRGB\ncolor  encoding.  So if you use jpeg2ktopam to convert a JP2 image to PPM, it changes the vi‐\nsual image (slightly) -- the colors in the output are not the same as in the input.\n\nIn the PAM image, the output samples are numerically identical to the input samples.  If  the\ninput  samples  are  signed, they are represented in two's complement form in the output (be‐\ncause PAM samples are always unsigned).  The PAM plane numbers are identical to the JPC  com‐\nponent numbers.\n\nA  JPEG-2000  image  has  a  \"precision,\"  which is the number of bits used for each code (in\nNetpbm lingo, \"sample\").  Actually, each component has a separate precision.  The maxval of a\nPGM, PPM, or PAM output is the largest number you can represent in the JPEG-2000 precision of\nthe JPEG-2000 component with the greatest precision.   The  samples  in  all  components  are\nscaled  to that maxval.  So if the red component has a precision of 4 bits and the green com‐\nponent has a precision of 6 bits, the maxval is 63 and  the  red  component  codes  from  the\nJPEG-2000 image are multiplied by 63/15 to generate the output samples.\n\njpeg2ktopam  interprets the JPEG-2000 input with the \u001b]8;;http://www.ece.uvic.ca/~mdadams/jasper/\u001b\\Jasper JPEG-2000 library\u001b]8;;\u001b\\ .  See documen‐\ntation of the library for details on what jpeg2ktopam handles.  Note that the Jasper  library\ncontains  facilities for writing PNM images, but jpeg2ktopam does not use those.  It uses the\nNetpbm library instead.  Note that the makers of the Jasper library write  it  \"JasPer,\"  but\nNetpbm  documentation  follows  standard American English typography rules, which don't allow\nthat kind of capitalization.\n\nUse pamtojpeg2k to convert in the other direction.\n\nThe program jasper, which is packaged with the Jasper JPEG-2000 library,  also  converts  be‐\ntween  JPEG-2000  and PNM formats.  Because it's packaged with the library, it may exploit it\nbetter, especially recently added features.  However, since it does not use  the  Netpbm  li‐\nbrary to read and write the Netpbm formats, it doesn't do as good a job on that side.\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "In  addition  to  the options common to all programs based on libnetpbm (most notably -quiet,\nsee \u001b]8;;index.html#commonoptions\u001b\\ Common Options\u001b]8;;\u001b\\ ), jpeg2ktopam recognizes the following command line options:\n\n\n\n",
            "subsections": [
                {
                    "name": "-verbose",
                    "content": "This option causes jpeg2ktopam to issue informational messages  about  the  conversion\nprocess.\n\n"
                },
                {
                    "name": "-debuglevel",
                    "content": "This  option controls debug messages from the Jasper library.  jpeg2ktopam passes num‐\nber as the debug level to the Jasper JPEG-2000 decoder.\n\n\n\n"
                }
            ]
        },
        "EXAMPLES": {
            "content": "jpeg2ktopam myimg.jpc >myimg.ppm\n\n\n",
            "subsections": []
        },
        "ABOUT JPEG-2000": {
            "content": "See the pamtojpeg2k manual(1) for  general  information  on  JPEG-2000  compression  and  the\nJPEG-2000 formats.\n\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "pamtojpeg2k(1), jpegtopnm(1), ppm(1), pgm(1), pbm(1), pam(1),\n\n",
            "subsections": []
        },
        "HISTORY": {
            "content": "jpeg2ktopam was added to Netpbm in Release 10.12 (November 2002).\n\nBefore Netpbm 10.49 (December 2009), jpeg2ktopam could not convert a JP2 file -- only JPC.\n",
            "subsections": []
        },
        "DOCUMENT SOURCE": {
            "content": "This  manual  page  was  generated by the Netpbm tool 'makeman' from HTML source.  The master\ndocumentation is at\n\nhttp://netpbm.sourceforge.net/doc/jpeg2ktopam.html\n\nnetpbm documentation                       08 October 2009                Jpeg2ktopam User Manual(1)",
            "subsections": []
        }
    },
    "summary": "jpeg2ktopam - convert JPEG-2000 code stream to PAM/PNM",
    "flags": [
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This option causes jpeg2ktopam to issue informational messages about the conversion process."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "This option controls debug messages from the Jasper library. jpeg2ktopam passes num‐ ber as the debug level to the Jasper JPEG-2000 decoder."
        }
    ],
    "examples": [
        "jpeg2ktopam myimg.jpc >myimg.ppm"
    ],
    "see_also": [
        {
            "name": "pamtojpeg2k",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pamtojpeg2k/1/json"
        },
        {
            "name": "jpegtopnm",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/jpegtopnm/1/json"
        },
        {
            "name": "ppm",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ppm/1/json"
        },
        {
            "name": "pgm",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pgm/1/json"
        },
        {
            "name": "pbm",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pbm/1/json"
        },
        {
            "name": "pam",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/pam/1/json"
        }
    ]
}