JPEG2KTOPAM(1)

πŸ“¦
version 11.13.03 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ 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), jpeg2ktopam generates a PGM image β€” unless the image contains only one bit per pixel, in which case jpeg2ktopam generates PBM.
  • if the color space is RGB (JAS_IMAGE_CS_RGB), jpeg2ktopam generates a PPM image.
  • if the input image is anything else, jpeg2ktopam generates a PAM image 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 causes jpeg2ktopam to 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. jpeg2ktopam passes number as 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

  • jpeg2ktopam was added to Netpbm in Release 10.12 (November 2002). throwback era fr πŸ•°οΈβœ¨
  • before Netpbm 10.49 (December 2009), jpeg2ktopam could not convert a JP2 file β€” only JPC. 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