Scroll to navigation



opjh_compress - This program reads in an image of a certain type and converts it to a jpeg2000 file. It is part of the OpenJPH library.


The following arguments are necessary:

-i input file name (either pgm, ppm, tif(f), or raw(yuv))

-o output file name

The following option has a default value (optional):

(5) number of decompositions
(0.00001...0.5) quantization step size for lossy compression; quantization steps size for all subbands are derived from this value. {The default value for 8bit images is 0.0039}
(false) for irreversible; this should be false to perform lossy compression using the 9/7 wavelet transform; or true to perform reversible compression, where the 5/3 wavelet is employed with lossless compression.

-colour_trans (true) this option employs a color transform, to

transform RGB color images into the YUV domain. This option should not be used with YUV images, because they have already been transformed. If there are three color components that are downsampled by the same amount then the color transform can be true or false. This option is also available when there are more than three colour components, where it is applied to the first three colour components. it has already been applied to convert the original RGB or whatever the original format to YUV.
(RPCL) is the progression order, and can be one of: LRCP, RLCP, RPCL, PCRL, CPRL
{x,y} (64,64) where x and y are the height and width of a codeblock. In unix-like environment, { and } must be proceeded by a \
{x,y},{x,y},...,{x,y} where {x,y} is the precinct size starting from the coarest resolution; the last precinct is repeated for all finer resolutions
{x,y} tile offset.
{x,y} tile width and height.

-image_offset {x,y} image offset from origin.

(None) is the profile, the code will check if the selected options meet the profile. Currently only BROADCAST and IMF are supported

When the input file is a YUV file, these arguments need to be

supplied: -dims {x,y} x is image width, y is height -num_comps number of components -signed a comma-separated list of true or false parameters, one
for each component; for example: true,false,false

-bit_depth a comma-separated list of bit depth values, one per

component; for example: 12,10,10
{x,y},{x,y},...,{x,y} a list of x,y points, one for each component; for example {1,1},{2,2},{2,2}


This manual page was written by Mathieu Malaterre <> for the Debian GNU/Linux system (but may be used by others).

March 2022 ojph_compress 0.8.2