This is the opj_compress utility from the OpenJPEG project. It compresses various image formats with the JPEG 2000 algorithm. It has been compiled against openjp2 library v2.5.4. Default encoding options: ------------------------- * Lossless * 1 tile * RGB->YCC conversion if at least 3 components * Size of precinct : 2^15 x 2^15 (means 1 precinct) * Size of code-block : 64 x 64 * Number of resolutions: 6 * No SOP marker in the codestream * No EPH marker in the codestream * No sub-sampling in x or y direction * No mode switch activated * Progression order: LRCP * No ROI upshifted * No offset of the origin of the image * No offset of the origin of the tiles * Reversible DWT 5-3 Note: ----- The markers written to the main_header are : SOC SIZ COD QCD COM. COD and QCD never appear in the tile_header. Parameters: ----------- Required Parameters (except with -h): One of the two options -ImgDir or -i must be used -i Input file Known extensions are If used, '-o ' must be provided -o Output file (accepted extensions are j2k or jp2). -ImgDir Image file Directory path (example ../Images) When using this option -OutFor must be used -OutFor Output format for compressed files. Required only if -ImgDir is used -F ,,,,{s,u}@x:...:x Characteristics of the raw or yuv input image If subsampling is omitted, 1x1 is assumed for all components Example: -F 512,512,3,8,u@1x1:2x2:2x2 for raw or yuv 512x512 size with 4:2:0 subsampling Required only if RAW or RAWL input file is provided. Optional Parameters: -h Display the help information. -r ,,... Different compression ratios for successive layers. The rate specified for each quality level is the desired compression factor (use 1 for lossless) Decreasing ratios required. Example: -r 20,10,1 means quality layer 1: compress 20x, quality layer 2: compress 10x quality layer 3: compress lossless Options -r and -q cannot be used together. -q ,,,... Different psnr for successive layers (-q 30,40,50). Increasing PSNR values required, except 0 which can be used for the last layer to indicate it is lossless. Options -r and -q cannot be used together. -n Number of resolutions. It corresponds to the number of DWT decompositions +1. Default: 6. -TargetBitDepth Target bit depth. Number of bits per component to use from input image if all bits are unwanted. (Currently only implemented for TIF.) -b , Code-block size. The dimension must respect the constraint defined in the JPEG-2000 standard (no dimension smaller than 4 or greater than 1024, no code-block with more than 4096 coefficients). The maximum value authorized is 64x64. Default: 64x64. -c [,],[,],... Precinct size. Values specified must be power of 2. Multiple records may be supplied, in which case the first record refers to the highest resolution level and subsequent records to lower resolution levels. The last specified record is halved successively for each remaining lower resolution levels. Default: 2^15x2^15 at each resolution. -t , Tile size. Default: the dimension of the whole image, thus only one tile. -p Progression order. Default: LRCP. -s Subsampling factor. Subsampling bigger than 2 can produce error Default: no subsampling. -POC //... Progression order change. The syntax of a progression order change is the following: T=,,,,, Example: -POC T1=0,0,1,5,3,CPRL/T1=5,0,1,6,3,CPRL -SOP Write SOP marker before each packet. -EPH Write EPH marker after each header packet. -PLT Write PLT marker in tile-part header. -TLM Write TLM marker in main header. -M Mode switch. [1=BYPASS(LAZY) 2=RESET 4=RESTART(TERMALL) 8=VSC 16=ERTERM(SEGTERM) 32=SEGMARK(SEGSYM)] Indicate multiple modes by adding their values. Example: RESTART(4) + RESET(2) + SEGMARK(32) => -M 38 -TP Divide packets of every tile into tile-parts. Division is made by grouping Resolutions (R), Layers (L) or Components (C). -ROI c=,U= Quantization indices upshifted for a component. Warning: This option does not implement the usual ROI (Region of Interest). It should be understood as a 'Component of Interest'. It offers the possibility to upshift the value of a component during quantization step. The value after c= is the component number [0, 1, 2, ...] and the value after U= is the value of upshifting. U must be in the range [0, 37]. -d Offset of the origin of the image. -T Offset of the origin of the tiles. -I Use the irreversible DWT 9-7. -mct <0|1|2> Explicitly specifies if a Multiple Component Transform has to be used. 0: no MCT ; 1: RGB->YCC conversion ; 2: custom MCT. If custom MCT, "-m" option has to be used (see hereunder). By default, RGB->YCC conversion is used if there are 3 components or more, no conversion otherwise. -m Use array-based MCT, values are coma separated, line by line No specific separators between lines, no space allowed between values. If this option is used, it automatically sets "-mct" option to 2. -cinema2K <24|48> Digital Cinema 2K profile compliant codestream. Need to specify the frames per second for a 2K resolution. Only 24 or 48 fps are currently allowed. -cinema4K Digital Cinema 4K profile compliant codestream. Frames per second not required. Default value is 24fps. -IMF [,mainlevel=X][,sublevel=Y][,framerate=FPS] Interoperable Master Format compliant codestream. =2K, 4K, 8K, 2K_R, 4K_R or 8K_R. X >= 0 and X <= 11. Y >= 0 and Y <= 9. framerate > 0 may be specified to enhance checks and set maximum bit rate when Y > 0. -GuardBits value Number of guard bits in [0,7] range. Usually 1 or 2 (default value). -jpip Write jpip codestream index box in JP2 output file. Currently supports only RPCL order. -C Add in the comment marker segment. -threads Number of threads to use for encoding or ALL_CPUS for all available cores.