---
name: "opj_jp3d_compress"
section: "1"
platform: "linux"
package: "libopenjp3d7"
version: "2.4.0-3"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/opj_jp3d_compress"
---

# opj\_jp3d\_compress(1)

compress source file to jp3d

## NAME

opj\_jp3d\_compress - compress source file to jp3d

## SYNOPSIS

**opj\_jp3d\_compress** \[optional arguments\] -i source.{bin, pgx} -m characteristics.img -o destination.{jp3d}

## OPTIONS

### Required Parameters (except with **-h**):

**-i**           : source file  (**-i** source.bin or source\*.pgx)

**-m**           : source characteristics file (**-m** imgfile.img)

**-o**           : destination file (**-o** dest.jp3d)

### Optional Parameters:

**-h**           : display the help information

**-n**           : number of resolutions (**-n** 3,3,3)

**-I**           : use the irreversible transforms: ICT + DWT 9-7 (**-I**)

**-C**           : coding algorithm (**-C** 2EB) \[2EB, 3EB\]

**-r**           : different compression ratios for successive layers (**-r** 20,10,5)

-

  The rate specified for each quality level is the desired compression factor, rate 1 means lossless compression (options **-r** and **-q** cannot be used together).

**-q**           : different psnr for successive layers (**-q** 30,40,50)

-

  (options **-r** and **-q** cannot be used together)

**-b**           : size of code block (**-b** 32,32,32)

**-c**           : size of precinct (**-c** 128,128,128)

**-t**           : size of tile (**-t** 512,512,512)

**-p**           : progression order (**-p** LRCP) \[LRCP, RLCP, RPCL, PCRL, CPRL\]

**-s**           : subsampling factor (**-s** 2,2,2) \[-s X,Y,Z\]

-

  Note: subsampling bigger than 2 can produce error.

**-SOP**         : write SOP marker before each packet

**-EPH**         : write EPH marker after each header packet

**-M**           : code-block style (**-M** 0)

-

  \[1=BYPASS(LAZY) 2=RESET 4=RESTART(TERMALL) 8=VSC 16=PTERM 32=SEGSYM 64=3DCTXT\]

-

  Indicate multiple modes by adding their values, for example: RESTART(4) + RESET(2) + SEGMARK(32) = **-M** 38

**-D**           : define DC offset (**-D** 12)

**-x**           : create an index file \*.Idx (**-x** index\_name.Idx)

**-ROI**         : c=%d,U=%d

-

  Quantization indices upshifted for component c=%d \[%d = 0,1,2\] with a value of U=%d \[0 \<= %d \<= 37\] (i.e. **-ROI**:c=0,U=25)

**-d**           : offset of the origin of the volume (**-d** 150,300,100)

**-l**           : offset of the origin of the tiles (**-l** 100,75,25)

### Default coding:

\- Lossless

\- 1 tile

\- Size of precinct : 2^15 x 2^15 x 2^15 (means 1 precinct)

\- Size of code-block : 64 x 64 x 64

\- Number of resolutions in x, y and z axis: 3

\- No SOP marker in the codestream

\- No EPH marker in the codestream

\- No sub-sampling in x, y or z direction

\- No mode switch activated

\- Progression order: LRCP

\- No index file

\- No ROI upshifted

\- No offset of the origin of the volume

\- No offset of the origin of the tiles

\- Reversible DWT 5-3 on each 2D slice

\- Coding algorithm: 2D-EBCOT

### Remarks:

The markers written to the main\_header are : SOC SIZ COD QCD COM.

COD and QCD markers will never appear in the tile\_header.

You need enough disk space memory (twice the original) to encode the volume, i.e. for a 1.5 GB volume you need a minimum of 3GB of disk memory)

When loading \*.pgx files, a relative path to directory is needed for input argument followed by the common prefix of the slices and a '\*' character representing sequential numeration ( **-i** relativepath/slices\*.pgx ).

The index file has the structure below:

-

  Image\_height Image\_width Image\_depth

-

  Progression order: 0 (LRCP)

-

  Tiles\_size\_X Tiles\_size\_Y Tiles\_size\_Z

-

  Components\_nb

-

  Layers\_nb

-

  Decomposition\_levels

-

  \[Precincts\_size\_X\_res\_Nr Precincts\_size\_Y\_res\_Nr Precincts\_size\_Z\_res\_Nr\]

-

  ...

-

  \[Precincts\_size\_X\_res\_0 Precincts\_size\_Y\_res\_0 Precincts\_size\_Z\_res\_0\]

-

  Main\_header\_end\_position

-

  Codestream\_size

-

  Tile\_0 \[start\_pos end\_header end\_pos TotalDisto NumPix MaxMSE\] ...

-

  Tile\_Nt \[  ''         ''        ''        ''       ''    ''  \]

-

  Tpacket\_0 \[Tile layer res. comp. prec. start\_pos end\_pos disto\] ...

-

  Tpacket\_Np \[''   ''    ''   ''    ''       ''       ''     '' \]

-

  MaxDisto

-

  TotalDisto

## AUTHOR

This  manual  page was written by Mathieu Malaterre \<malat@debian.org\> and Hugo Lefeuvre \<hle@debian.org\> for the Debian GNU/Linux system, but may be used by others.
