summary refs log tree commit diff
path: root/jpeg2ktopam.html
blob: 8f18303ad2d35021594c3e88048165cc71b32b21 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.3//EN">
<html><head><title>Jpeg2ktopam User Manual</title></head>
<body>
<h1>jpeg2ktopam</h1>
Updated: 08 October 2009
<br>
<a href="#index">Table Of Contents</a>

<h2>NAME</h2>
jpeg2ktopam - convert JPEG-2000 code stream to PAM/PNM

<h2 id="synopsis">SYNOPSIS</h2>

<b>jpeg2ktopam</b>
[<b>-verbose</b>]
[<b>-debuglevel=</b><i>number</i>]
<i>filename</i>

<?makeman .SH OPTION USAGE ?>

<p>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.

<h2 id="description">DESCRIPTION</h2>

<p>This program is part of <a href="index.html">Netpbm</a>.

<p><b>jpeg2ktopam</b> 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.

<p>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.  <b>jpeg2ktopam</b> converts both.

<p>If the color space identified in the image is grayscale
(JAS_IMAGE_CS_GRAY), <b>jpeg2ktopam</b> generates a PGM image, unless the
image contains only one bit per pixel, in which case <b>jpeg2ktopam</b>
generates PBM.  If the color space is RGB (JAS_IMAGE_CS_RGB),
<b>jpeg2ktopam</b> generates a PPM image.  If the input image is anything
else, <b>jpeg2ktopam</b> generates a PAM image with no tuple type identified.

<p>In the PGM and PPM cases, <b>jpeg2ktopam</b> 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 <b>jpeg2ktopam</b> 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.

<p>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.

<p>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.

<p><b>jpeg2ktopam</b> interprets the JPEG-2000 input with the <a
href="http://www.ece.uvic.ca/~mdadams/jasper/">Jasper JPEG-2000
library</a>.  See documentation of the library for details on what
<b>jpeg2ktopam</b> handles.  Note that the Jasper library contains
facilities for writing PNM images, but <b>jpeg2ktopam</b> 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.

<p>Use <b>pamtojpeg2k</b> to convert in the other direction.

<p>The program <b>jasper</b>, 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.

<h2 id="options">OPTIONS</h2>

<p>In addition to the options common to all programs based on libnetpbm
(most notably <b>-quiet</b>, see <a href="index.html#commonoptions">
Common Options</a>), <b>jpeg2ktopam</b> recognizes the following
command line options:

<dl compact>

<dt><b>-verbose</b>

<dd>This option causes <b>jpeg2ktopam</b> to issue informational
messages about the conversion process.

<dt><b>-debuglevel</b>=<i>number</i>

<dd>This option controls debug messages from the Jasper library.  
<b>jpeg2ktopam</b> passes <i>number</i> as the debug level to the Jasper
JPEG-2000 decoder.

</dl>
     
<h2 id="examples">EXAMPLES</h2>

<pre>
  jpeg2ktopam myimg.jpc &gt;myimg.ppm
</pre>

<h2 id="jpeg2000">ABOUT JPEG-2000</h2>

<p>See <a href="pamtojpeg2k.html">the <b>pamtojpeg2k</b> manual</a>
for general information on JPEG-2000 compression and the
JPEG-2000 formats.

<h2 id="seealso">SEE ALSO</h2>

<b><a href="pamtojpeg2k.html">pamtojpeg2k</a></b>,
<b><a href="jpegtopnm.html">jpegtopnm</a></b>,
<b><a href="ppm.html">ppm</a></b>,
<b><a href="pgm.html">pgm</a></b>,
<b><a href="pbm.html">pbm</a></b>,
<b><a href="pam.html">pam</a></b>,

<h2 id="history">HISTORY</h2>

<p><b>jpeg2ktopam</b> was added to Netpbm in Release 10.12 (November 2002).

<p>Before Netpbm 10.49 (December 2009), <b>jpeg2ktopam</b> could not convert
a JP2 file -- only JPC.

<hr>
<h2 id="index">Table Of Contents</h2>
<ul>
<li><a href="#synopsis">SYNOPSIS</a>
<li><a href="#description">DESCRIPTION</a>
<li><a href="#options">OPTIONS</a>
<li><a href="#examples">EXAMPLES</a>
<li><a href="#jpeg2000">ABOUT JPEG-2000</a>
<li><a href="#seealso">SEE ALSO</a>
<li><a href="#history">HISTORY</a>
</ul>
</body>
</html>