jasper
[options]
The jasper command converts image data from one format to another. In other words, this command functions as a general-purpose transcoder. Since the JPEG-2000 format is supported by this software, it can be used as a JPEG-2000 encoder and/or decoder.
The jasper program accepts the following options:
--help
--version
.--verbose
--list-enabled-formats
--memory-limit $n
$n
bytes.--debug-level $level
$level
.--input $file
or -f $file
$file
. By default, the input image is read from standard input.--input-format $format
or -t $format
$format
. In most circumstances, this option should not be needed, as the format is normally autodetected by examining the image data directly or deduced from the input file name extension if an input file is specified (via the --input
option).--input-option $option
or -o $option
$option
to the decoder. The valid values for the argument $option
are determined by the input image format. See below for more details.--output $file
or -F $file
$file
. By default, the encoded image is written to standard output.--output-format $format
or -T $format
$format
. The output format must be specified if an output file is not given (via the --output
option). If an output file is given and no output format is specified, an attempt will be made to deduce the correct format from the output file name extension.--output-option $option
or -O $option
$option
to the encoder. The valid values for the argument $option
are determined by the output format. See below for more details.--force-srgb
Assuming that JasPer is built with all codec support included (so that all codecs are available for use), the argument $format
must have one of the following values:
bmp
: Windows BMPheic
: HEIC Formatjp2
: JPEG-2000 JP2jpc
: JPEG-2000 Code Streamjpg
: JPEGpgx
: PGXpnm
: PNM/PGM/PPMmif
: My Image Formatras
: Sun RasterfileA list of the available formats is included in the help information for the program (obtained via the --help
option).
To obtain information on how to use the jasper
program, use the command:
jasper --help
Suppose that we have an image stored in the PNM/PPM format in a file called lena.ppm
. To encode this image (losslessly) in the JPEG-2000 JP2 format, and store the result in a file called lena.jp2
, use the command:
jasper --input lena.ppm --output lena.jp2 --output-format jp2
Or, alternately (using short option names), use the command:
jasper -f lena.ppm -F lena.jp2 -T jp2
Suppose that we have a RGB color image stored in the JPEG-2000 JP2 format in a file called lena.jp2
. To encode this image in the PNM/PPM format, and store the result in a file called lena.ppm
, use the command:
jasper --input lena.jp2 --output lena.ppm --output-format pnm
Or, alternately (using short option names), use the command:
jasper -f lena.jp2 -F lena.ppm -T pnm
Suppose that we have an image stored in the BMP format in a file called lena.bmp
. To encode this image in a lossy manner at 100:1 compression in the JPEG-2000 (code stream) format, and store the result in a file called lena_lossy.jpc
, use the command:
jasper -f lena.bmp -F lena_lossy.jpc -T jpc -O rate=0.01
Suppose that we have an image stored in a file called sachie.pnm
in the PNM/PPM format, and we want to encode the image in the JPEG-2000 (code stream) format and store the result in a file named sachie_new.jpc
. Further, suppose that we want the JPEG-2000 format to employ the following parameters:
In order to accomplish the above, type:
jasper -f sachie.pnm -F sachie_new.jpc -T jpc -O cblkwidth=64 \ -O cblkheight=32 -O nomct -O numrlvls=4 -O rate=0.015625