1opj_compress(1) converts to jpeg2000 files opj_compress(1)
2
3
4
6 opj_compress - This program reads in an image of a certain type and
7 converts it to a jpeg2000 file. It is part of the OpenJPEG library.
8
9 Valid input image extensions are .bmp, .pgm, .pgx, .png, .pnm, .ppm,
10 .raw, .tga, .tif . For PNG resp. TIF it needs libpng resp. libtiff .
11
12 Valid output image extensions are .j2k, .jp2
13
15 opj_compress -i infile.bmp -o outfile.j2k
16
17 opj_compress -ImgDir directory_name -OutFor jp2
18
19 opj_compress -h Print a help message and exit.
20
21 See JPWL OPTIONS for special options
22
24 -b n,n
25 (Size of code block (e.g. -b 32,32). Default: 64 x 64)
26
27 -c n (Size of precinct (e.g. -c 128,128). Default: 2^15 x 2^15)
28
29 -cinema2K fps
30 Digital Cinema 2K profile compliant codestream. Valid fps values
31 are 24 or 48.
32
33 -cinema4K
34 Digital Cinema 4K profile compliant codestream. Does not need an
35 fps: default is 24 fps.
36
37 -d X,Y
38 (Offset of image origin (e.g. -d 150,300))
39
40 -h Print a help message and exit.
41
42 -i name
43 (input file name)
44
45 -n n (Number of resolutions. Default: 6)
46
47 -o name
48 (output file name)
49
50 -p name
51 Progression order. name can be one out of:LRCP, RLCP, RPCL,
52 PCRL, CPRL. Default: LRCP.
53
54 -q n different psnr for successive layers
55 Note: (options -r and -q cannot be used together)
56
57 -r n different compression ratio(s) for successive layers. The rate
58 specified for each quality level is the desired compression fac‐
59 tor.
60 Note: (options -r and -q cannot be used together)
61
62 -s X,Y
63 sub-sampling factor (e.g. -s 2,2). Default: No sub-sampling in x
64 or y direction.
65 Remark: sub-sampling bigger than 2 can produce errors.
66
67 -t W,H
68 (Size of tile (e.g. -t 512,512) )
69
70 -x name
71 (Create index file and fill it. Default: no index file)
72
73 -EPH (Write EPH marker after each header packet. Default:no EPH)
74
75 -F rawWidth,rawHeight,rawComp,rawBitDepth,s_or_u
76 characteristics of the raw input image
77
78 -I (Use the irreversible DWT 9-7. Default: Reversible DWT 5-3)
79
80 -ImgDir directory_name
81 (directory containing input files)
82
83 -M n mode switch with values: 1, 2, 4, 8, 16, 32. Default:No mode
84 switch activated.
85 Meaning:
86 BYPASS(1)
87 RESET(2)
88 RESTART(4)
89 VSC(8)
90 ERTERM(16)
91 SEGMARK(32)
92 Values can be added: RESTART(4) + RESET(2) + SEGMARK(32) = -M 38
93
94 -OutFor ext
95 (extension for output files)
96
97 -POC TtileNr=resolutionStart, componentStart, layerEnd, resolutionEnd,
98 componentEnd, progressionOrder
99 (see Examples)
100
101 -ROI c=n,U=n
102 quantization indices upshifted for component c (0 or 1 or 2)
103 with a value of U (>= 0 and <= 37)
104 e.g. -ROI c=0,U=25
105
106 -SOP (Write SOP marker before each packet. Default: No SOP marker in
107 the codestream.)
108
109 -T X,Y (Offset of the origin of the tiles (e.g. -T 100,75) )
110
111 -W (see JPWL OPTIONS)
112
114 Options usable only if the library has been compiled with -DUSE_JPWL
115
116 -W h<tilepart><=type>, s<tilepart><=method>, a=<addr>, z=<size>,
117 g=<range>, p<tilepart:pack><=type>
118
119 h selects the header error protection (EPB): type can be
120 [0=none 1,absent=predefined 16=CRC-16 32=CRC-32 37-128=RS]
121 if tilepart is absent, it is for main and tile headers
122 if tilepart is present, it applies from that tile
123 onwards, up to the next h<> spec, or to the last tilepart
124 in the codestream (max. 16 specs)
125
126 p selects the packet error protection (EEP/UEP with EPBs)
127 to be applied to raw data: type can be
128 [0=none 1,absent=predefined 16=CRC-16 32=CRC-32 37-128=RS]
129 if tilepart:pack is absent, it is from tile 0, packet 0
130 if tilepart:pack is present, it applies from that tile
131 and that packet onwards, up to the next packet spec
132 or to the last packet in the last tilepart in the stream
133 (max. 16 specs)
134
135 s enables sensitivity data insertion (ESD): method can be
136 [-1=NO ESD 0=RELATIVE ERROR 1=MSE 2=MSE REDUCTION 3=PSNR
137 4=PSNR INCREMENT 5=MAXERR 6=TSE 7=RESERVED]
138 if tilepart is absent, it is for main header only
139 if tilepart is present, it applies from that tile
140 onwards, up to the next s<> spec, or to the last tilepart
141 in the codestream (max. 16 specs)
142
143 g determines the addressing mode: range can be
144 [0=PACKET 1=BYTE RANGE 2=PACKET RANGE]
145
146 a determines the size of data addressing: addr can be
147 2/4 bytes (small/large codestreams). If not set, auto-mode
148
149 z determines the size of sensitivity values: size can be
150 1/2 bytes, for the transformed pseudo-floating point value
151
153 opj_compress -i file.bmp -o file.j2k -r 20,10,1 (compress 20x, then
154 10x, then lossless).
155
156 opj_compress -i file.ppm -o file.j2k -q 30,40,50
157
158 opj_compress -i file.pgx -o file.j2k -POC T1=0,0,1,5,3,CPRL
159
160 opj_compress -i lena.raw -o lena.j2k -F 512,512,3,8,u
161
163 Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Bel‐
164 gium
165 Copyright (c) 2002-2014, Professor Benoit Macq
166 Copyright (c) 2001-2003, David Janssens
167 Copyright (c) 2002-2003, Yannick Verschueren
168 Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
169 Copyright (c) 2005, Herve Drolon, FreeImage Team
170 Copyright (c) 2006-2007, Parvatha Elangovan
171
173 opj_decompress(1) opj_dump(1)
174
175
176
177
178opj_compress Version 2.1.1 opj_compress(1)