1Pamtojpeg2k User Manual(0)                          Pamtojpeg2k User Manual(0)
2
3
4

NAME

6       pamtojpeg2k - convert PAM/PNM image to a JPEG-2000 code stream
7
8

SYNOPSIS

10       pamtojpeg2k [-imgareatlx=column] [-imgareatly=row] [-tilegrdtlx=column]
11       [-tilegrdtly=row]        [-tilewidth=columns]        [-tileheight=rows]
12       [-prcwidth=columns]        [-prcheight=rows]       [-cblkwidth=columns]
13       [-cblkheight=rows]   [-mode={integer|int|real}]    [-compression=ratio]
14       [-ilyrrates=ratestring]          [-numrlvls=number]          [-progres‐
15       sion={lrcp|rlcp|rpcl|pcrl|cprl}]  [-numgbits=number]  [-nomct]   [-sop]
16       [-eph]  [-lazy]  [-termall]  [-segsym] [-vcausal] [-pterm] [-resetprob]
17       [-verbose] [-debuglevel=number] filename
18
19       Minimum unique abbreviation of option is acceptable.  You may use  dou‐
20       ble  hyphens  instead  of single hyphen to denote options.  You may use
21       white space in place of the equals sign to separate an option name from
22       its value.
23
24
25

DESCRIPTION

27       This program is part of Netpbm(1).
28
29       pamtojpeg2k  converts the named PBM, PGM, PPM, or PAM file, or Standard
30       Input if no file is named, to a JPEG-2000 code  stream  (JPC)  file  on
31       Standard Output.
32
33       The  JPEG-2000  specification  specifies two different formats: JP2 and
34       JPEG-2000 code stream (JPC).   JP2  represents  a  visual  image  quite
35       specifically,  whereas  JPC is a more or less arbitrary array of codes.
36       pamtojpeg2k can't produce a JP2, but the  JPC  image  that  pamtojpeg2k
37       produces  is  very  similar to a JP2 if the input is a PBM, PGM, or PPM
38       image or equivalent PAM image.  One difference is that that RGB  inten‐
39       sity  values in a JP2 are SRGB values, while pamtojpeg2k produces ITU-R
40       Recommedation BT.709 values.  Those are very similar, but  not  identi‐
41       cal.   Another  difference  is that a JP2 can contain extra information
42       about an image that JPC cannot.
43
44       When the input is a PAM image other than a PBM, PGM, or PPM equivalent,
45       the  JPC raster produced contains whatever the PAM raster does.  It can
46       have any number of planes with any meanings; the planes are in the same
47       order in the JPC output as in the PAM input.
48
49       A  JPC  image  has  a "precision," which is the number of bits used for
50       each code (in Netpbm lingo, "sample").  Actually,  it  has  a  separate
51       precision  for  each  component.  pamtojpeg2k uses for the precision of
52       every component the least number of bits that can represent the  maxval
53       of  the  input image.  A JPC image does not have an independent concept
54       of maxval; the maxval of a JPC sample is the  maximum  value  that  the
55       number  of bits specified by the precision can represent in pure binary
56       code.  E.g. if the precision is 4, the maxval is 15.  pamtojpeg2k  does
57       of  course  scale the sample values from the input maxval to the output
58       maxval.  Example: The input maxval is 99.  This means JPC precision  is
59       7  bits  and  the JPC maxval is 127.  A sample value of 33 in the input
60       becomes a sample value of 43 in the output.
61
62       pamtojpeg2k generates the JPC output with the Jasper JPEG-2000  library
63http://www.ece.uvic.ca/~mdadams/jasper/⟩  .   See documentation of the
64       library for details on what pamtojpeg2k produces.  Note that the Jasper
65       library  contains  facilities  for  reading PNM images, but pamtojpeg2k
66       does not use those.  It uses the Netpbm library instead.  Note that the
67       makers  of  the Jasper library write it "JasPer," but Netpbm documenta‐
68       tion follows standard American English typography  rules,  which  don't
69       allow that kind of capitalization.
70
71       Use jpeg2ktopam to convert in the other direction.
72
73       The  program  jasper,  which  is  packaged  with  the  Jasper JPEG-2000
74       library, also converts between JPEG-2000 and PNM formats.  Because it's
75       packaged  with  the  library,  it  may  exploit  it  better, especially
76       recently added features.  However, since it does  not  use  the  Netpbm
77       library  to  read and write the Netpbm formats, it doesn't do as good a
78       job on that side.
79
80

OPTIONS

82       Most of the options are identical in name and function to options  that
83       the   Jasper   library   JPC  encoder  subroutine  takes.   See  Jasper
84       documentation ⟨http://www.ece.uvic.ca/~mdadams/jasper/⟩   for  details.
85       Here,  we  document  only options that are not direct analogs of Jasper
86       options.
87
88
89
90
91       -compression=ratio
92              ratio is a floating point number that specifies the  compression
93              ratio.   pamtojpeg2k  will adjust quality as necessary to ensure
94              that you get this compression ratio.  E.g. 4  means  the  output
95              will be about one fourth the size in bytes of the input file.
96
97              The  compression  ratio  must  be at least 1.  The default is 1,
98              which means the output has all the quality of the input  --  the
99              conversion is lossless.
100
101              Note that though Jasper library takes a compression factor, this
102              option specifies a compression ratio.  The compression factor is
103              the  multiplicative  inverse  of  (1 divided by) the compression
104              ratio.
105
106
107       -verbose
108              This option causes pamtojpeg2k to issue  informational  messages
109              about the conversion process.
110
111
112       -debuglevel=number
113              This  option  controls  debug  messages from the Jasper library.
114              pamtojpeg2k passes number as the debug level to the  Jasper  JPC
115              encoder.
116
117
118
119

EXAMPLES

121       This example compresses losslessly.
122
123         pamtojpeg2k myimg.ppm >myimg.jpc
124
125       jpeg2ktopam will recreate myimg.ppm exactly.
126
127       This example compresses the file to one tenth its original size, throw‐
128       ing away information as necessary.
129
130         pamtojpeg2k -compression=10 myimg.pgm >myimg.jpc
131
132
133

ABOUT JPEG-2000

135       JPEG-2000 is a format that compresses a visual image (or a similar  set
136       of  data)  into  a minimal number of bytes for storage or transmission.
137       In that, its goal is similar to JPEG.  It has two main differences from
138       JPEG.
139
140       One  difference  is  that  it  does a much better job on most images of
141       throwing out information in order to achieve a  smaller  output.   That
142       means  when  you  reconstruct  the  image from the resulting compressed
143       file, it looks a  lot  closer  to  the  image  you  started  with  with
144       JPEG-2000  than  with  JPEG,  for  the  same compressed file size.  Or,
145       looked at another way, with JPEG-2000 you get a much smaller file  than
146       with JPEG for the same image quality.
147
148       The  second difference is that with JPEG-2000, you decide how much com‐
149       pression you want and the compressor adjusts the quality to  meet  your
150       requirement,  whereas  with  JPEG, you decide how much quality you want
151       and the compressor adjusts the size of the output to meet your require‐
152       ment.   I.e.  with  JPEG-2000, the quality of the result depends on the
153       compressibility of the input, but with JPEG, the  size  of  the  result
154       depends on the compressibility of the input.
155
156       With  JPEG-2000,  you  can specify lossless compression, thus making it
157       compete with GIF and PNG.  With standard JPEG, you  always  lose  some‐
158       thing.   (There  are  rumored  to be variations of JPEG around that are
159       lossless, though).
160
161       JPEG is much older than JPEG-2000 and far more popular.  JPEG is one of
162       the half dozen most popular graphics formats and virtually all graphics
163       facilities understand it.  JPEG-2000 is virtually unknown.
164
165       There is no compatibility between JPEG and  JPEG-2000.   Programs  that
166       read JPEG do not automatically read JPEG-2000 and vice versa.
167
168
169

SEE ALSO

171       jpeg2ktopam(1), pnmtopeg(1), ppm(1), pgm(1), pbm(1), pam(1),
172
173

History

175       pamtojpeg2k was added to Netpbm in Release 10.12 (November 2002).
176
177
178
179netpbm documentation            27 October 2002     Pamtojpeg2k User Manual(0)
Impressum