wcompress
True compression of images using wavelets
Syntax
Description
The wcompress
function performs either compression or
uncompression of grayscale or truecolor images.
Compression
wcompress('c',
compresses the image x
,cname
,compmthd
)x
using the compression method
compmthd
and saves the result in the file cname
. The
image x
can be either a 2-D array containing an indexed image or a 3-D
array of uint8
containing a truecolor image. Both the row and column size of
the image must be powers of two.
You must have write permission in the current working directory or the function will
change directory to tempdir
and write the compressed image in that directory.
Note
The Discrete Wavelet Transform uses the periodized extension mode.
Data written to the files uses
uint64
precision. In releases previous to R2016b, data was written usinguint32
. If your code is affected adversely by this change, use thelegacy
option to compress and uncompress your data using the previous behavior.wcompress('c',x,cname,compmthd,'legacy')
wcompress('c',I,___)
converts the indexed image
I{1}
to a truecolor image Y using the colormap
I{2}
and then compresses Y.
wcompress(___,
specifies
options related to display, data transform, and compression methods using one or more
name-value pair arguments in addition to the input arguments in previous syntaxes. The name can
be in uppercase or lowercase. For example, Name,Value
)'level',3,'CC','klt'
sets the
level of the decomposition to 3 and the Color Conversion parameter if x
is
a truecolor image to the Karhunen-Loève transform.
Uncompression
Examples
Input Arguments
Output Arguments
References
[1] Christophe, Emmanuel, Pierre Duhamel, and Corinne Mailhes. “Adaptation of Zerotrees Using Signed Binary Digit Representations for 3D Image Coding.” EURASIP Journal on Image and Video Processing 2007, no. 1 (2007): 054679. https://doi.org/10.1186/1687-5281-2007-054679.
[2] Misiti, Michel, Yves Misiti, Georges Oppenheim, and Jean-Michel Poggi, eds. Wavelets and Their Applications. London, UK: ISTE, 2007. https://doi.org/10.1002/9780470612491.
[3] Said, A., and W.A. Pearlman. “A New, Fast, and Efficient Image Codec Based on Set Partitioning in Hierarchical Trees.” IEEE Transactions on Circuits and Systems for Video Technology 6, no. 3 (June 1996): 243–50. https://doi.org/10.1109/76.499834.
[4] Shapiro, J.M. “Embedded Image Coding Using Zerotrees of Wavelet Coefficients.” IEEE Transactions on Signal Processing 41, no. 12 (December 1993): 3445–62. https://doi.org/10.1109/78.258085.
[5] Strang, Gilbert, and Truong Nguyen. Wavelets and Filter Banks. Rev. ed. Wellesley, Mass: Wellesley-Cambridge Press, 1997.
[6] Walker, James S. "Wavelet-Based Image Compression." Sub-chapter in Transform and Data Compression. A Primer on Wavelets and Their Scientific Applications. Vol. 29. Studies in Advanced Mathematics. CRC Press, 1999. https://doi.org/10.1201/9781420050011.
Version History
Introduced in R2008b