]> granicus.if.org Git - imagemagick/blob - www/jp2.html
(no commit message)
[imagemagick] / www / jp2.html
1
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
3   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4 <html version="-//W3C//DTD XHTML 1.1//EN"
5       xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
6       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7       xsi:schemaLocation="http://www.w3.org/1999/xhtml
8                           http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd">
9 <head>
10   <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
11   <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4"/>
12   <title>ImageMagick: JP2 Encoding Options</title>
13   <meta http-equiv="content-language" content="en-US"/>
14   <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
15   <meta http-equiv="reply-to" content="magick-users@imagemagick.org"/>
16   <meta name="application-name" content="ImageMagick"/>
17   <meta name="description" content="Use ImageMagick to convert, edit, or compose bitmap images in a variety of formats.  In addition, resize, rotate, shear, distort or transform images automagically."/>
18   <meta name="application-url" content="http://www.imagemagick.org"/>
19   <meta name="generator" content="PHP"/>
20   <meta name="keywords" content="jp2, encoding, options, ImageMagick, PerlMagick, image processing, OpenMP, software development library, image, photo, software, Magick++, MagickWand"/>
21   <meta name="rating" content="GENERAL"/>
22   <meta name="robots" content="INDEX, FOLLOW"/>
23   <meta name="generator" content="ImageMagick Studio LLC"/>
24   <meta name="author" content="ImageMagick Studio LLC"/>
25   <meta name="revisit-after" content="2 DAYS"/>
26   <meta name="resource-type" content="document"/>
27   <meta name="copyright" content="Copyright (c) 1999-2012 ImageMagick Studio LLC"/>
28   <meta name="distribution" content="Global"/>
29   <link rel="icon" href="../images/wand.png"/>
30   <link rel="shortcut icon" href="../images/wand.ico"  type="images/x-icon"/>
31   <link rel="canonical" href="http://www.imagemagick.org" />
32   <link rel="meta" type="application/rdf+xml" title="ICI" href="http://imagemagick.org/ici.rdf"/>
33
34   <!-- Add jQuery library -->
35   <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
36   
37   <!-- Add mousewheel plugin (this is optional) -->
38   <script type="text/javascript" src="http://www.imagemagick.org/fancybox/lib/jquery.mousewheel-3.0.6.pack.js"></script>
39   
40   <!-- Add fancyBox -->
41   <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/jquery.fancybox.css?v=2.0.6" type="text/css" media="screen" />
42   <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/jquery.fancybox.pack.js?v=2.0.6"></script>
43   
44   <!-- Optionally add helpers - button, thumbnail and/or media -->
45   <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.css?v=1.0.2" type="text/css" media="screen" />
46   <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.js?v=1.0.2"></script>
47   <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-media.js?v=1.0.0"></script>
48   
49   <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.css?v=2.0.6" type="text/css" media="screen" />
50   <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.js?v=2.0.6"></script>
51   
52   <script type="text/javascript">
53         $(document).ready(function() {
54                 $(".fancybox").fancybox();
55         });
56   </script>
57
58   <!-- ImageMagick style -->
59   <style type="text/css" media="all">
60     @import url("../www/magick.css");
61   </style>
62 </head>
63
64 <body id="www-imagemagick-org">
65
66 <script>
67   (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
68   (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
69   m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
70   })(window,document,'offline-script','//127.0.0.1/analytics.js','ga');
71
72   ga('create', 'UA-40133312-1', 'imagemagick.org');
73   ga('send', 'pageview');
74 </script>
75
76 <div class="titlebar">
77 <div style="margin: 17px auto; float: left;">
78   <script type="text/javascript">
79   <!--
80     google_ad_client = "pub-3129977114552745";
81     google_ad_slot = "5439289906";
82     google_ad_width = 728;
83     google_ad_height = 90;
84   //-->
85   </script>
86   <script type="text/javascript"
87     src="http://127.0.0.1/pagead/show_ads.js">
88   </script>
89 </div>
90 <a href="http://www.imagemagick.org/discourse-server/">
91   <img src="../images/logo.jpg"
92   alt="ImageMagick Logo"
93   style="width: 123px; height: 118px; border: 0px; float: right;" /></a>
94 <a href="../index.html">
95   <img src="../images/sprite.jpg"
96   alt="ImageMagick Sprite"
97   style="width: 114px; height: 118px; border: 0px; float: right;" /></a>
98 </div>
99
100 <div class="westbar">
101
102 <div class="menu">
103   <a title="About ImageMagick" href="../index.html">About ImageMagick</a>
104 </div>
105 <div class="menu">
106   <a title="Binary Releases" href="binary-releases.html">Binary Releases</a>
107 </div>
108 <div class="sub">
109     <a title="Binary Release: Unix" href="binary-releases.html#unix">Unix</a>
110 </div>
111 <div class="sub">
112     <a title="Binary Release: MacOS X" href="binary-releases.html#macosx">Mac OS X</a>
113 </div>
114 <div class="sub">
115     <a title="Binary Release: iOS" href="binary-releases.html#iOS">iOS</a>
116 </div>
117 <div class="sub">
118     <a title="Binary Release: Windows" href="binary-releases.html#windows">Windows</a>
119 </div>
120 <div class="sep"></div>
121 <div class="menu">
122   <a title="Command-line Tools" href="command-line-tools.html">Command-line Tools</a>
123 </div>
124 <div class="sub">
125     <a title="Command-line Tools: Processing" href="command-line-processing.html">Processing</a>
126 </div>
127 <div class="sub">
128     <a title="Command-line Tools: Options" href="command-line-options.html">Options</a>
129 </div>
130 <div class="sub">
131     <a title="Command-line Tools: Usage" href="http://www.imagemagick.org/Usage/">Usage</a>
132 </div>
133 <div class="menu">
134   <a title="Program Interfaces" href="api.html">Program Interfaces</a>
135 </div>
136 <div class="sub">
137     <a title="Program Interface: MagickWand" href="magick-wand.html">MagickWand</a>
138 </div>
139 <div class="sub">
140     <a title="Program Interface: MagickCore" href="magick-core.html">MagickCore</a>
141 </div>
142 <div class="sub">
143     <a title="Program Interface: PerlMagick" href="perl-magick.html">PerlMagick</a>
144 </div>
145 <div class="sub">
146     <a title="Program Interface: Magick++" href="magick++.html">Magick++</a>
147 </div>
148 <div class="sep"></div>
149 <div  class="menu">
150    <a title="Install from Source" href="install-source.html">Install from Source</a>
151 </div>
152 <div class="sub">
153     <a title="Install from Source: Unix" href="install-source.html#unix">Unix</a>
154 </div>
155 <div class="sub">
156     <a title="Install from Source: Windows" href="install-source.html#windows">Windows</a>
157  </div>
158 <div class="menu">
159   <a title="Resources" href="resources.html">Resources</a>
160 </div>
161 <div class="menu">
162   <a title="Architecture" href="architecture.html">Architecture</a>
163 </div>
164 <div class="menu">
165   <a title="Download" href="download.html">Download</a>
166 </div>
167 <div class="sep"></div>
168 <div class="menu">
169   <a title="Search" href="search.html">Search</a>
170 </div>
171 <div class="sep"></div>
172 <div class="menu">
173   <a title="Site Map" href="sitemap.html">Site Map</a>
174 </div>
175 <div  class="sub">
176   <a title="Site Map: Links" href="links.html">Links</a>
177 </div>
178 <div class="sep"></div>
179 <div class="menu">
180   <a title="Support ImageMagick Development" href="support.html">Support ImageMagick Development</a>
181 </div>
182 </div>
183
184 <div class="eastbar">
185   <script type="text/javascript">
186     /* <![CDATA[ */
187     (function() {
188         var po = document.createElement('offline-script'), t = document.getElementsByTagName('offline-script')[0];
189         po.type = 'text/javascript';
190         po.async = true;
191         po.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
192         var script = document.getElementsByTagName('offline-script')[0];
193         script.parentNode.insertBefore(po, script);
194     })();
195     /* ]]> */
196   </script>
197   <div> <a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="http://www.imagemagick.org/"></a></div>
198   <noscript>
199     <a href="http://flattr.com/thing/947300/Convert-Edit-And-Compose-Images" target="_blank">
200     <img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" width="93" height="20" border="0" /></a>
201   </noscript>
202     <div class="g-plusone" id="gplusone"></div>
203     <script type="text/javascript">
204       /* <![CDATA[ */
205       window.___gcfg = {
206         lang: 'en-US'
207       };
208
209       (function() {
210         var po = document.createElement('offline-script');
211         po.type = 'text/javascript';
212         po.async = true;
213         po.src = 'https://127.0.0.1/js/plusone.js';
214         var script = document.getElementsByTagName('offline-script')[0];
215         script.parentNode.insertBefore(po, script);
216       })();
217       var gplusone = document.getElementById("gplusone");
218       gplusone.setAttribute("data-size","medium");
219       gplusone.setAttribute("data-count","true");
220       /* ]]> */
221     </script>
222 </div>
223
224 <div class="main">
225
226 <h1>ImageMagick JPEG-2000 Image Format</h1>
227 <p class="navigation-index"></p>
228
229 <p>ImageMagick's JPEG-2000 image formats, JP2 and JPC, accept a plethora of encoding options as detailed below.  As an example, suppose you are interested in these options:</p>
230
231 <ul>
232 <li>code blocks are 64 samples in width and 32 samples in height</li>
233 <li>no multicomponent transform</li>
234 <li>4 resolution levels for each component</li>
235 <li>compression is lossy at 64:1</li>
236 </ul>
237
238 <p>Use this command:</p>
239
240 <p class='crt'><span class="crtprompt"> $ </span><span class='crtin'>convert wizard.png -define jp2:cblkwidth=64 -define jp2:cblkheight=32  \ <br/>
241   -define jp2:nomct -define jp2:numrlvls=4 -define jp2:rate=0.015625 wizard.jpc</span></p>
242 <p>Here we convert a giga-byte TIFF image to JPEG-2000 with a reduced memory footprint:</p>
243
244 <p class='crt'><span class="crtprompt"> $ </span><span class='crtin'>convert frame-00038.tif -define jp2:tilewidth=256 -define jp2:tileheight=256 frame-00038.jp2</span></p>
245 <p>Here is a lossy example using the full gamut of JP2 options:</p>
246
247 <p class='crt'><span class="crtprompt"> $ </span><span class='crtin'>convert input.tif -define numrlvls=7 -define jp2:tilewidth=1024
248 -define jp2:tileheight=1024 \<br />-define jp2:rate=0.02348 -define
249 jp2:prg=rpcl -define jp2:mode=int -define jp2:prcwidth=16383 \<br />-define
250 jp2:prcheight=16383 -define jp2:cblkwidth=64 -define jp2:cblkheight=64
251 -define jp2:sop output.jp2</span></p>
252 <p>Here is the same example with lossless encoding:</p>
253 <p class='crt'><span class="crtprompt"> $ </span><span class='crtin'>convert input.tif -define jp2:numrlvls=6 -define jp2:tilewidth=1024
254 -define jp2:tileheight=1024 \<br />-define jp2:rate=1.0 -define jp2:lazy
255 -define jp2:prg=rlcp -define jp2:ilyrrates=\<br />'0.015625,0.01858,0.0221,0.025,0.03125,0.03716,0.04419,0.05,0.0625,
256 0.075,0.088,0.1,0.125,0.15,0.18,0.21,0.25,0.3,0.35,0.4,0.5,0.6,0.7,0.84'
257 \<br />-define jp2:mode=int output.jp2</span></p>
258 <p>Here is a complete list of JPEG-2000 encoding options:</p>
259
260 <dl class="doc">
261 <dt class="doc">imgareatlx=x</dt>
262 <dd>Set the x-coordinate of the top-left corner of the image area to x.</dd>
263 <dt class="doc">imgareatly=y</dt>
264 <dd>Set the y-coordinate of the top-left corner of the image area to y.</dd>
265 <dt class="doc">tilegrdtlx=x</dt>
266 <dd>Set the x-coordinate of the top-left corner of the tiling grid to x.</dd>
267 <dt class="doc">tilegrdtly=y</dt>
268 <dd>Set the y-coordinate of the top-left corner of the tiling grid to y.</dd>
269 <dt class="doc">tilewidth=w</dt>
270 <dd>Set the nominal tile width to w.</dd>
271 <dt class="doc">tileheight=h</dt>
272 <dd>Set the nominal tile height to h.</dd>
273 <dt class="doc">prcwidth=w</dt>
274 <dd>Set the precinct width to w. The argument w must be an integer power of two. The default value is 32768.</dd>
275 <dt class="doc">prcheight=h</dt>
276 <dd>Set the precinct height to h. The argument h must be an integer power of two. The default value is 32768.</dd>
277 <dt class="doc">cblkwidth=w</dt>
278 <dd>Set the nominal code block width to w. The argument w must be an integer power of two.  The default value is 64.</dd>
279 <dt class="doc">cblkheight=h</dt>
280 <dd>Set the nominal code block height to h. The argument h must be an integer power of two. The default value is 64.</dd>
281 <dt class="doc">mode=m</dt>
282 <dd>Set the coding mode to m. The argument m must have one of the following values:
283
284 <table class="doc">
285   <tbody>
286   <tr>
287     <th align="left">Value</th>
288     <th align="left">Description</th>
289   </tr>
290
291   <tr> <td>int</td>    <td>integer mode</td> </tr>
292   <tr> <td>real</td>    <td>real mode</td> </tr>
293   </tbody>
294 </table>
295 </dd>
296
297 <dd>If lossless coding is desired, the integer mode must be used. By default, the integer mode is employed. The choice of mode also determines which multicomponent and wavelet transforms (if any) are employed.</dd>
298 <dt class="doc">rate=r</dt>
299 <dd>Specify the target rate. The argument r is a positive real number. Since a rate of one corresponds to no compression, one should never need to explicitly specify a rate greater than one.  By default, the target rate is considered to be infinite.</dd>
300 <dt class="doc">ilyrrates=r0[,r1,. . . ,rN]</dt>
301 <dd>Specify the rates for any intermediate layers. The argument to this option is a comma separated list of N rates. Each rate is a positive real number. The rates must increase monotonically.  The last rate in the list should be less than or equal to the overall rate (as specified with the rate option).</dd>
302 <dt class="doc">prg=p</dt>
303 <dd>Set the progression order to p. The argument p must have one of the following values:
304
305 <table class="doc">
306   <tbody>
307   <tr>
308     <th align="left">Value</th>
309     <th align="left">Description</th>
310   </tr>
311
312   <tr> <td>lrcp</td>    <td>layer-resolution-component-position (LRCP) progressive (i.e., rate scalable)</td> </tr>
313   <tr> <td>rlcp</td>    <td>resolution-layer-component-position (RLCP) progressive (i.e., resolution scalable)</td> </tr>
314   <tr> <td>rpcl</td>    <td>resolution-position-component-layer (RPCL) progressive</td> </tr>
315   <tr> <td>pcrl</td>    <td>position-component-resolution-layer (PCRL) progressive</td> </tr>
316   <tr> <td>cprl</td>    <td>component-position-resolution-layer (CPRL) progressive</td> </tr>
317   </tbody>
318 </table>
319 </dd>
320
321 <dd>By default, LRCP progressive ordering is employed. Note that the RPCL and PCRL progressions are not valid for all possible image geometries.</dd>
322 <dt class="doc">nomct</dt>
323 <dd>Disallow the use of any multicomponent transform.</dd>
324 <dt class="doc">numrlvls=n</dt>
325 <dd>Set the number of resolution levels to n. The argument n must be an integer that is greater than or equal to one. The default value is 6.</dd>
326 <dt class="doc">sop</dt>
327 <dd>Generate SOP marker segments.</dd>
328 <dt class="doc">eph</dt>
329 <dd>Generate EPH marker segments.</dd>
330 <dt class="doc">lazy</dt>
331 <dd>Enable lazy coding mode (a.k.a. arithmetic coding bypass).</dd>
332 <dt class="doc">termall</dt>
333 <dd>Terminate all coding passes.</dd>
334 <dt class="doc">segsym</dt>
335 <dd>Use segmentation symbols.</dd>
336 <dt class="doc">vcausal</dt>
337 <dd>Use vertically stripe causal contexts.</dd>
338 <dt class="doc">pterm</dt>
339 <dd>Use predictable termination.</dd>
340 <dt class="doc">resetprob</dt>
341 <dd>Reset the probability models after each coding pass.</dd>
342 <dt class="doc">numgbits=n</dt>
343 <dd>Set the number of guard bits to n.</dd>
344 </dl>
345
346 </div>
347
348 <div id="linkbar">
349     <span id="linkbar-west">&nbsp;</span>
350
351     <span id="linkbar-center">
352       <a href="http://www.imagemagick.org/discourse-server/">Discourse Server</a> &#8226;
353       <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Studio</a> &#8226;
354       <a href="http://jqmagick.imagemagick.org/">JqMagick</a>
355     </span>
356     <span id="linkbar-east">&nbsp;</span>
357   </div>
358   <div class="footer">
359     <span id="footer-west">&copy; 1999-2013 ImageMagick Studio LLC</span>
360     <span id="footer-east"> <a href="contact.html">Contact the Wizards</a></span>
361   </div>
362   <div style="clear: both; margin: 0; width: 100%; "></div>
363 </body>
364 </html>