JPEG2KTOPAM(1)
β¨ jpeg2ktopam β the manual β¨
okay bestie, welcome to the Jpeg2ktopam User Manual, straight out of the General Commands Manual section π this is the glow-up guide to turning JPEG-2000 files into PAM/PNM files and honestly? it eats.
π NAME
jpeg2ktopam β convert JPEG-2000 code stream to PAM/PNM
πΈ SYNOPSIS
jpeg2ktopam [-verbose] [-debuglevel=number] filename
π OPTION USAGE
okay so the rules of the game, bestie, and they're honestly so chill:
- Minimum unique abbreviation of option is acceptable. you don't gotta spell the whole thing out, just enough letters that it's unambiguous π
- you can use double hyphens instead of a single hyphen to denote options. either one works, no cap.
- you can use white space in place of the equals sign to separate an option name from its value. so flexible. we love that for you. π«Ά
π¦ DESCRIPTION
so this program is part of Netpbm(1) π
jpeg2ktopam converts the named JPEG-2000 file (JP2 or JPC), or Standard Input if no file is named, to a PBM, PGM, PPM, or PAM file on Standard Output. iconic behavior honestly β¨
now, the JPEG-2000 specification specifies two different formats: JP2 and JPEG-2000 code stream (JPC). JP2 represents a visual image quite specifically, whereas JPC is a more or less arbitrary array of codes. a JP2 image contains a JPC stream and metadata describing how that stream represents a visual image. jpeg2ktopam converts both. she's versatile like that πββοΈ
here's the color space tea β:
- if the color space identified in the image is grayscale (
JAS_IMAGE_CS_GRAY),jpeg2ktopamgenerates aPGMimage β unless the image contains only one bit per pixel, in which casejpeg2ktopamgeneratesPBM. - if the color space is RGB (
JAS_IMAGE_CS_RGB),jpeg2ktopamgenerates aPPMimage. - if the input image is anything else,
jpeg2ktopamgenerates aPAMimage with no tuple type identified.
in the PGM and PPM cases, jpeg2ktopam assumes the intensity values in the input image have the same meaning as for PGM and PPM. one thing that implies is the ITU-R Recommendation BT.709 color space, which means the assumption is false for JP2 input. JP2 input uses SRGB color encoding. so if you use jpeg2ktopam to convert a JP2 image to PPM, it changes the visual image (slightly) β the colors in the output are not the same as in the input. not me gaslighting your color values π
in the PAM image, the output samples are numerically identical to the input samples. if the input samples are signed, they are represented in two's complement form in the output (because PAM samples are always unsigned). the PAM plane numbers are identical to the JPC component numbers. no funny business, fr fr.
a JPEG-2000 image has a "precision," which is the number of bits used for each code (in Netpbm lingo, "sample"). actually, each component has a separate precision. the maxval of a PGM, PPM, or PAM output is the largest number you can represent in the JPEG-2000 precision of the JPEG-2000 component with the greatest precision. the samples in all components are scaled to that maxval. so if the red component has a precision of 4 bits and the green component has a precision of 6 bits, the maxval is 63 and the red component codes from the JPEG-2000 image are multiplied by 63/15 to generate the output samples. math girlies, we rise πβ¨
jpeg2ktopam interprets the JPEG-2000 input with the Jasper JPEG-2000 library . see documentation of the library for details on what jpeg2ktopam handles. note that the Jasper library contains facilities for writing PNM images, but jpeg2ktopam does not use those β it uses the Netpbm library instead. also note that the makers of the Jasper library write it "JasPer," but Netpbm documentation follows standard American English typography rules, which don't allow that kind of capitalization. rules are rules bestie π
use pamtojpeg2k to convert in the other direction π«Ά
also, the program jasper, which is packaged with the Jasper JPEG-2000 library, also converts between JPEG-2000 and PNM formats. because it's packaged with the library, it may exploit it better, especially recently added features. however, since it does not use the Netpbm library to read and write the Netpbm formats, it doesn't do as good a job on that side. she's got range but she's got weaknesses π
π OPTIONS
in addition to the options common to all programs based on libnetpbm (most notably -quiet, see Common Options), jpeg2ktopam recognizes the following command line options:
-verboseβ this option causesjpeg2ktopamto issue informational messages about the conversion process. she's a yapper, and honestly? good for her π¬-debuglevel=numberβ this option controls debug messages from the Jasper library.jpeg2ktopampassesnumberas the debug level to the Jasper JPEG-2000 decoder. let her spill the backend tea π
π EXAMPLES
jpeg2ktopam myimg.jpc >myimg.ppm
simple. clean. effective. she ate π β¨
π§ ABOUT JPEG-2000
see the pamtojpeg2k manual(1) for general information on JPEG-2000 compression and the JPEG-2000 formats π go read your other book bestie.
π SEE ALSO
pamtojpeg2k(1), jpegtopnm(1), ppm(1), pgm(1), pbm(1), pam(1),
(the whole friend group right there π«Ά)
β HISTORY
jpeg2ktopamwas added to Netpbm in Release 10.12 (November 2002). throwback era fr π°οΈβ¨- before Netpbm 10.49 (December 2009),
jpeg2ktopamcould not convert aJP2file β onlyJPC. glow-up confirmed, she learned new things π±
π DOCUMENT SOURCE
this manual page was generated by the Netpbm tool makeman from HTML source. the master documentation is at
http://netpbm.sourceforge.net/doc/jpeg2ktopam.html
and that's the whole page bestie π this was netpbm documentation, dated 08 October 2009, from the Jpeg2ktopam User Manual(1) β periodt π β¨ go convert something gorgeous π¦
π¦ where this page comes from
- debian bookworm: netpbm 2:11.01.00-2 Β· MIT
- debian trixie: netpbm 2:11.10.02-1 Β· MIT
- ubuntu noble: netpbm 2:11.05.02-1.1build1 Β· MIT
- ubuntu resolute: netpbm 2:11.10.02-1build1 Β· MIT
- ubuntu stonking: netpbm 2:11.13.03+ds-2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms