.TL Jpeg2ktopam User Manual .SH 1 Jpeg2ktopam .LP Updated: 27 October 2002 .br Table Of Contents .SH 2 NAME .LP jpeg2ktopam - convert JPEG-2000 code stream to PAM/PNM .SH 2 SYNOPSIS .LP \fBjpeg2ktopam\fR [\fB-verbose\fR] [\fB-debuglevel=\fR\fInumber\fR] \fIfilename\fR .LP Minimum unique abbreviation of option is acceptable. You may use double hyphens instead of single hyphen to denote options. You may use white space in place of the equals sign to separate an option name from its value. .SH 2 DESCRIPTION .LP .LP This program is part of Netpbm. .LP \fBjpeg2ktopam\fR converts the named JPEG-2000 code stream file, or Standard Input if no file is named, to a PBM, PGM, PPM, or PAM file on Standard Output. .LP 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. JP2 images are a subset of JPC images. \fBjpeg2ktopam\fR converts any JPC image. If the color space identified in the image is grayscale (JAS_IMAGE_CS_GRAY), \fBjpeg2ktopam\fR generates a PGM image, unless the image contains only one bit per pixel, in which case \fBjpeg2ktopam\fR generates PBM. If the color space is RGB (JAS_IMAGE_CS_RGB), \fBjpeg2ktopam\fR generates a PPM image. If the input image is anything else, \fBjpeg2ktopam\fR generates a PAM image with no tuple type identified. .LP In the PGM and PPM cases, \fBjpeg2ktopam\fR 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 \fBjpeg2ktopam\fR 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. .LP 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. .LP A JPC 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 JPC precision of the JPC 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 JPC image are multiplied by 63/15 to generate the output samples. .LP \fBjpeg2ktopam\fR interprets the JPC input with the Jasper JPEG-2000 library. See documentation of the library for details on what \fBjpeg2ktopam\fR handles. Note that the Jasper library contains facilities for writing PNM images, but \fBjpeg2ktopam\fR does not use those. It uses the Netpbm library instead. 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. .LP Use \fBpamtojpeg2k\fR to convert in the other direction. .LP The program \fBjasper\fR, 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. .SH 2 OPTIONS .LP .RS .IP "\fB-verbose\fR" This option causes \fBjpeg2ktopam\fR to issue informational messages about the conversion process. .IP "\fB-debuglevel\fR=\fInumber\fR" This option controls debug messages from the Jasper library. \fBjpeg2ktopam\fR passes \fInumber\fR as the debug level to the Jasper JPC decoder. .RE .SH 2 EXAMPLES .LP .DS L jpeg2ktopam myimg.jpc >myimg.ppm .DE .SH 2 ABOUT JPEG-2000 .LP .LP See the \fBpamtojpeg2k\fR manual for general information on JPEG-2000 compression and the JPEG-2000 formats. .SH 2 SEE ALSO .LP \fBjpctopam\fR, \fBpnmtopeg\fR, \fBppm\fR, \fBpgm\fR, \fBpbm\fR, \fBpam\fR, .SH 2 History .LP .LP \fBjpeg2ktopam\fR was added to Netpbm in Release 10.12 (November 2002). .br \l'5i' .SH 2 Table Of Contents .LP .IP \(bu SYNOPSIS .IP \(bu DESCRIPTION .IP \(bu OPTIONS .IP \(bu EXAMPLES .IP \(bu SEE ALSO .LP