📄 usage_examples.txt
字号:
compression is not all that radically different from the linear
opponent transform applied to the gamma corrected colour channels
in the CIELab colour space. It follows that this representation
should have properties similar to Lab at D50 and can easily be
converted (by means of a well conditioned linear transform) into
a true D50 Lab space.
p) kdu_compress -i image.ppm -o out.jp2 -rate -,0.05 Clayers=30
Creversible=yes Rshift=12 Rlevels=5 -roi {0.3,0.1},{0.5,0.5}
-- Compresses a colour image losslessly using the max-shift ROI method
to ensure that a square region of is assigned much higher priority
in the layer generation process. The region represents one quarter of
the total number of image pixels and starts 30% of the way down and
10% of the way across from the left of the image. Reconstructing the
initial layers (you can use kdu_show, kdu_expand or kdu_transcode to
partially reconstructing or pair down the image) leaves an extremely
low quality in the background (everything other than the region of
interest) but a rapidly improving quality in the foreground as more
and more layers arrive. The foreground becomes lossless before
the background improves substantially -- it eventually becomes lossless
too.
q) kdu_compress -i image.ppm -o out.jp2 -rate -,0.5 Clayers 30 Cblk={32,32}
Creversible=yes Rweight=7 Rlevels=5 -roi mask.pgm,0.5
-- Another region of interest encoding example. In this case the region
is found from the mask image -- the foreground corresponds to the
mask pixels whose values exceed 50% of the dynamic range (i.e., 128).
The mask image is automatically scaled to fit the dimensions of each
image component (scaling and region propogation are done incrementally
so as to minimize memory consumption). In this case, the max-shift
method is not used. Instead, the distortion cost function which drives
the PCRD-opt layer formation algorithm is modulated by the region
characteristics. The transition from background to foreground is
softer than in the max-shift case and may be controlled by `Rweight'.
Region definition is poorer than with the max-shift method, but a
number of important disadvantages are avoided. For more on this,
consult the "kakadu.pdf" document.
kdu_expand
----------
a) kdu_expand -i in.j2c -o out.pgm
-- decompress input code-stream (or first image component thereof).
b) kdu_expand -i in.j2c -o out.pgm -rate 0.7
-- read only the initial portion of the code-stream, corresponding to
an overall bit-rate of 0.7 bits/sample. It is generally preferrable
to use the transcoder to generate a reduced rate code-stream first,
but direct truncation works very well so long as the code-stream has
a layer-progressive organization with only one tile (unless
interleaved tile-parts are used).
c) kdu_expand -i in.j2c -o out.pgm -region {0.3,0.2},{0.6,0.4} -rotate 90
-- decompress a limited region of the original image (starts 30% down
and 20% in from left, extends for 60% of the original height and
40% of the original width). Concurrently rotates decompressed
image by 90 degrees clockwise (no extra memory or computational
resources required for rotation).
-- Note that the whole code-stream if often not loaded when a region
of interest is specified, as may be determined by observing the
reported bit-rate. This is particularly true of code-streams with
multiple tiles or spatially progressive packet sequencing.
d) kdu_expand -i in.j2c -o out.pgm -fussy
-- most careful to check for conformance with standard. Checks for
appearance of marker codes in the wrong places and so forth.
e) kdu_expand -i in.j2c -o out.pgm -resilient
-- similar to fussy, but should not fail if a problem is encountered
(except when problem concerns main or tile headers -- these can all
be put up front) -- recovers from and/or conceals errors to the
best of its ability.
f) kdu_expand -i in.j2c -o out.pgm -reduce 2
-- discard 2 resolution levels to generate an image whose dimensions
are each divided by 4.
g) kdu_expand -i in.j2c -o out.pgm -record log.txt
-- generate a log file containing all parameter attributes associated
with the compressed code-stream. Any or all of these may be
supplied to "kdu_compress" (often via a switch file).
-- note that the log file may be incomplete if you instruct
the decompressor to decompress only a limited region of interest
so that one or more tiles may never be parsed.
h) kdu_expand -i in.j2c -cpu 0
-- measure end-to-end processing time, excluding only the writing of
the decompressed file (specifying an output file will cause the
measurement to be excessively influenced by the I/O associated
with file writing)
i) kdu_expand -i in.j2c -o out.pgm -precise
-- force the use of higher precision numerics than are probably
required (the implementation makes its own decisions based on
the output bit-depth). The same argument, supplied to the compressor
can also have some minor beneficial effect. Use the `-precise'
argument during compression and decompression to get reference
compression performance figures.
j) kdu_expand -i in.jp2 -o out.ppm
-- decompress a colour image wrapped up inside a JP2 file. Note that
sub-sampled colour components will not be interpolated nor will
any colour appearance transform be applied to the data. However,
palette indices will be de-palettized. This is probably the most
appropriate behaviour for an application which decompresses to a
file output. Renderers, such as "kdu_show" should do much more.
kdu_transcode
-------------
a) kdu_transcode -i in.j2c -o out.j2c -rate 0.5
-- reduce the bit-rate, using as much information as the quality layer
structure provides.
b) kdu_transcode -i in.j2c -o out.j2c -reduce 1
-- reduce image resolution by 2 in each direction
c) kdu_transcode -i in.j2c -o out.j2c -rotate 90
-- rotate image in compressed domain. Some minor distortion increase
will usually be observed (unless the code-stream was lossless) upon
decompression (with -rotate -90), but subsequent rotations or block
coder mode changes will not incur any distortion build-up.
d) kdu_transcode -i in.j2c -o out.j2c "Cmodes=ERTERM|RESTART" Cuse_eph=yes
Cuse_sop=yes
-- Add error resilience information.
e) kdu_transcode -i in.j2c -o out.j2c Cprecincts={128,128} Corder=PCRL
-- Convert to spatially progressive organization (even if precincts
were not originally used).
f) kdu_transcode -i in.jp2 -o out.j2c
-- Extracts the code-stream from inside a JP2 file.
kdu_show
--------
"kdu_show" is an interactive application, whose usage should be
self-explanatory. We make a special note of the following capabilities:
* You may open new image files at any time and may drag and drop files
onto the application's window.
* Files with a ".jp2" or ".jpx" suffix are opened as JP2 compatible files.
All others are opened as raw code-stream files.
* You may re-open a failed image file (often after setting the "mode" to
"resilient" or "resilient+SOP assumption").
* You may view all of the code-stream parameters and the tile structure
using the "properties" item of the "file" menu.
-- Note that double-clicking on any code-stream parameter attribute
displayed in the popup window will bring up a description of
the attribute.
* Lots of accelerators are defined for rapid navigation. Some of the
ones you may want to use a lot are:
-- w -> widens the display
-- s -> shrinks the display
-- arrow keys and page up/down -> rapid navigation
-- ctrl+z -> zooms out
-- z -> zooms in
-- p -> show properties
-- ] and [ -> rotate clockwise and counter-clockwise
-- 1,2,3,4,c -> display image component 1, 2, 3, 4 or
else appropriately mapped,
interpolated and colour converted
colour channels (m)
-- <,> -> adjust number of quality layers
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -