image_to_j2k(1)
π NAME
okay so bestie, image_to_j2k is that girl π
β she reads in an image of a certain type and converts it to a jpeg2000 file. She's part of the OpenJPEG library, so like, she has connections β¨.
Valid input image extensions are .bmp, .pgm, .pgx, .png, .pnm, .ppm, .raw, .tga, .tif. For PNG resp. TIF it needs libpng resp. libtiff β no cap, she can't do it alone π«Ά.
Valid output image extensions are .j2k, .jp2.
β¨ SYNOPSIS
image_to_j2k -i infile.bmp -o outfile.j2k
image_to_j2k -ImgDir directory_name -OutFor jp2
image_to_j2k -h Print a help message and exit.
π OPTIONS
here's the whole menu, bestie β every single one, no skipping, we don't do that here π
-b n,nβ size of code block (e.g.-b 32,32). Default:64 x 64.-c nβ size of precinct (e.g.-c 128,128). Default:2^15 x 2^15.-cinema2K fpsβ a Digital Cinema 2K profile compliant codestream. Validfpsvalues are24or48π¬.-cinema4Kβ a Digital Cinema 4K profile compliant codestream. This one does not need anfps: default is24fps.-d X,Yβ offset of image origin (e.g.-d 150,300).-hβ print a help message and exit. your literal bestie when you're lost π«Ά.-i nameβ input file name.-n nβ number of resolutions. Default:6.-o nameβ output file name.-p nameβ progression order.namecan be one out of:LRCP,RLCP,RPCL,PCRL,CPRL. Default:LRCP.-q nβ different psnr for successive layers.
Note: (options-rand-qcannot be used together) π¨
-r nβ different compression ratio(s) for successive layers. The rate specified for each quality level is the desired compression factor.
Note: (options-rand-qcannot be used together) π¨
-s X,Yβ sub-sampling factor (e.g.-s 2,2). Default: no sub-sampling in x or y direction.
Remark: sub-sampling bigger than 2 can produce errors. like, she will simply malfunction π
-t W,Hβ size of tile (e.g.-t 512,512).-x nameβ create index file and fill it. Default: no index file.-EPHβ write EPH marker after each header packet. Default: no EPH.-F rawWidth,rawHeight,rawComp,rawBitDepth,s_or_uβ characteristics of the raw input image.-Iβ use the irreversible DWT 9-7. Default: reversible DWT 5-3.-ImgDir directory_nameβ directory containing input files.-M nβ mode switch with values:1,2,4,8,16,32. Default: no mode switch activated. Meaning:BYPASS(1)RESET(2)RESTART(4)VSC(8)ERTERM(16)SEGMARK(32)
Values can be added: RESTART(4) + RESET(2) + SEGMARK(32) = -M 38 β math slay π₯
-OutFor extβ extension for output files.-POC TtileNr=resolutionStart, componentStart, layerEnd, resolutionEnd, componentEnd, progressionOrderβ (see Examples) π-ROI c=n,U=nβ quantization indices upshifted for componentc(0 or 1 or 2) with a value ofU(>= 0 and <= 37), e.g.-ROI c=0,U=25.-SOPβ write SOP marker before each packet. Default: no SOP marker in the codestream.-T X,Yβ offset of the origin of the tiles (e.g.-T 100,75).-Wβ (see JPWL OPTIONS) β¬οΈ
π₯ JPWL OPTIONS
Options usable only if the library has been compiled with -DUSE_JPWL β so if these do nothing for you, that's why, bestie π
-W h<tilepart><=type>, s<tilepart><=method>, a=<addr>, z=<size>, g=<range>, p<tilepart:pack><=type>hselects the header error protection (EPB):typecan be[0=none 1,absent=predefined 16=CRC-16 32=CRC-32 37-128=RS]- if
tilepartis absent, it is for main and tile headers - if
tilepartis present, it applies from that tile onwards, up to the nexth<>spec, or to the last tilepart in the codestream (max.16specs)
- if
pselects the packet error protection (EEP/UEP with EPBs) to be applied to raw data:typecan be[0=none 1,absent=predefined 16=CRC-16 32=CRC-32 37-128=RS]- if
tilepart:packis absent, it is from tile0, packet0 - if
tilepart:packis present, it applies from that tile and that packet onwards, up to the next packet spec or to the last packet in the last tilepart in the stream (max.16specs)
- if
senables sensitivity data insertion (ESD):methodcan be[-1=NO ESD 0=RELATIVE ERROR 1=MSE 2=MSE REDUCTION 3=PSNR 4=PSNR INCREMENT 5=MAXERR 6=TSE 7=RESERVED]- if
tilepartis absent, it is for main header only - if
tilepartis present, it applies from that tile onwards, up to the nexts<>spec, or to the last tilepart in the codestream (max.16specs)
- if
gdetermines the addressing mode:rangecan be[0=PACKET 1=BYTE RANGE 2=PACKET RANGE]adetermines the size of data addressing:addrcan be2/4bytes (small/large codestreams). If not set, auto-mode.zdetermines the size of sensitivity values:sizecan be1/2bytes, for the transformed pseudo-floating point value.
π EXAMPLES
like, real-world scenarios, iykyk π
image_to_j2k -i file.bmp -o file.j2k -r 20,10,1 (compress 20x, then 10x, then lossless).
image_to_j2k -i file.ppm -o file.j2k -q 30,40,50
image_to_j2k -i file.pgx -o file.j2k -POC T1=0,0,1,5,3,CPRL
image_to_j2k -i lena.raw -o lena.j2k -F 512,512,3,8,u
π AUTHORS
giving credit where credit is due, periodt π«Ά
- Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
- Copyright (c) 2002-2007, Professor Benoit Macq
- Copyright (c) 2001-2003, David Janssens
- Copyright (c) 2002-2003, Yannick Verschueren
- Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
- Copyright (c) 2005, Herve Drolon, FreeImage Team
- Copyright (c) 2006-2007, Parvatha Elangovan
π¦ SEE ALSO
go check out her friends fr fr: j2k_to_image(1) j2k_dump(1)
πΈ ok that's the whole page bestie, you ate that. this was image_to_j2k, Version 1.4.0 β the OpenJPEG library edition. go compress something iconic, mwah ππ
π¦ where this page comes from
- nixos 26.05: emscripten 5.0.6
- nixpkgs unstable: emscripten 6.0.9
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms