OS Manuals

/usr/bin/opj_decompress

openjpeg (development tools)

From openjpeg-tools 2.5.4-r3 (os), captured 2026-11-05 by running opj_decompress -h (exit 1). permalink

This is the opj_decompress utility from the OpenJPEG project.
It decompresses JPEG 2000 codestreams to various image formats.
It has been compiled against openjp2 library v2.5.4.

Parameters:
-----------

  -ImgDir <directory>
	Image file Directory path
  -OutFor <PBM|PGM|PPM|PNM|PAM|PGX|PNG|BMP|TIF|TIFF|RAW|YUV|RAWL|TGA>
    REQUIRED only if -ImgDir is used
	Output format for decompressed images.
  -i <compressed file>
    REQUIRED only if an Input image directory is not specified
    Currently accepts J2K-files, JP2-files and JPT-files. The file type
    is identified based on its suffix.
  -o <decompressed file>
    REQUIRED
    Currently accepts formats specified above (see OutFor option)
    Binary data is written to the file (not ascii). If a PGX
    filename is given, there will be as many output files as there are
    components: an indice starting from 0 will then be appended to the
    output filename, just before the "pgx" extension. If a PGM filename
    is given and there are more than one component, only the first component
    will be written to the file.
  -r <reduce factor>
    Set the number of highest resolution levels to be discarded. The
    image resolution is effectively divided by 2 to the power of the
    number of discarded levels. The reduce factor is limited by the
    smallest total number of decomposition levels among tiles.
  -l <number of quality layers to decode>
    Set the maximum number of quality layers to decode. If there are
    less quality layers than the specified number, all the quality layers
    are decoded.
  -x
    Create an index file *.Idx (-x index_name.Idx)
  -d <x0,y0,x1,y1>
    OPTIONAL
    Decoding area
    By default all the image is decoded.
  -t <tile_number>
    OPTIONAL
    Set the tile number of the decoded tile. Follow the JPEG2000 convention from left-up to bottom-up
    By default all tiles are decoded.
  -p <comp 0 precision>[C|S][,<comp 1 precision>[C|S][,...]]
    OPTIONAL
    Force the precision (bit depth) of components.
    There shall be at least 1 value. There is no limit on the number of values (comma separated, last values ignored if too much values).
    If there are less values than components, the last value is used for remaining components.
    If 'C' is specified (default), values are clipped.
    If 'S' is specified, values are scaled.
    A 0 value can be specified (meaning original bit depth).
  -c first_comp_index[,second_comp_index][,...]
    OPTIONAL
    To limit the number of components to decoded.
    Component indices are numbered starting at 0.
  -force-rgb
    Force output image colorspace to RGB
  -upsample
    Downsampled components will be upsampled to image size
  -split-pnm
    Split output components to different files when writing to PNM
  -threads <num_threads|ALL_CPUS>
    Number of threads to use for decoding or ALL_CPUS for all available cores.
  -allow-partial
    Disable strict mode to allow decoding partial codestreams.
  -quiet
    Disable output from the library and other output.
Options (12)
OptionDescriptionSource
-ImgDir directoryImage file Directory pathhelp
-OutForREQUIRED only if -ImgDir is used Output format for decompressed images.help
-xCreate an index file *.Idx (-x index_name.Idx)help
-d x0OPTIONAL Decoding area By default all the image is decoded.help
-t tile_numberOPTIONAL Set the tile number of the decoded tile.help
-c first_comp_indexOPTIONAL To limit the number of components to decoded.help
-force-rgbForce output image colorspace to RGBhelp
-upsampleDownsampled components will be upsampled to image sizehelp
-split-pnmSplit output components to different files when writing to PNMhelp
-threads num_threads|ALL_CPUSNumber of threads to use for decoding or ALL_CPUS for all available cores.help
-allow-partialDisable strict mode to allow decoding partial codestreams.help
-quietDisable output from the library and other output.help

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.