GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - GrokImageCompression/grok: World's Leading Open Source JPEG 2000 Codec

BranchesTags
Open more actions menu

Latest commit

 

History

1,162 Commits
1,162 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.vscode
.vscode
 
 
Testing/Temporary
Testing/Temporary
 
 
benchmark
benchmark
 
 
bindings
bindings
 
 
cmake
cmake
 
 
dist
dist
 
 
doc
doc
 
 
examples
examples
 
 
extern
extern
 
 
integrations/gdal
integrations/gdal
 
 
mercury
mercury
 
 
network
network
 
 
scripts
scripts
 
 
src
src
 
 
tests
tests
 
 
thirdparty
thirdparty
 
 
viewer
viewer
 
 
.clang-format
.clang-format
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.gitlab-ci.yml
.gitlab-ci.yml
 
 
.gitmodules
.gitmodules
 
 
CMakeLists.txt
CMakeLists.txt
 
 
Cargo.toml
Cargo.toml
 
 
DESIGN_TODO.md
DESIGN_TODO.md
 
 
INSTALL.md
INSTALL.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
TESTING.md
TESTING.md
 
 
format.sh
format.sh
 
 
grok.code-workspace
grok.code-workspace
 
 

Repository files navigation

Grok

badge-license badge-actions badge-oss-fuzz

Grok is an open-source JPEG 2000 codec licensed under AGPL v3.

Performance

Grok is integrated into GDAL. Benchmark results (16 threads, GDAL release build, Fedora 42):

Workflow Grok (JP2Grok) Kakadu (JP2KAK) OpenJPEG
Spot 6 (Network Storage) 35.17 s 344 s 85 s
Spot 6 (Local Storage) 26.92 s 30.57 s 52.09 s
Pleiades (Region) 0.74 s 1.41 s 4.28 s

Features

  • High Throughput JPEG 2000 (HTJ2K) support
  • Random-access sub-image decoding (TLM + PLT markers)
  • Multi-level tile cache with LRU eviction and compressed chunk caching
  • S3 / cloud storage with network fetch caching and disk spillover
  • ICC color profiles, XML/IPTC/XMP/EXIF metadata
  • Monochrome, sRGB, palette, YCC, extended YCC, CIELab, CMYK
  • 1–16 bit precision
  • Compression accepts GRK_INT_32 and GRK_INT_16 input. GRK_INT_16 supports signed precision up to 16 bits and unsigned precision up to 15 bits. Use grk_compress_get_recommended_data_type() to detect the direct 16-bit compression path.
  • JPEG/PNG/BMP/TIFF/RAW/PNM/PAM I/O
  • Linux (x86-64/AArch64), Windows, macOS, WebAssembly

For direct API compression, call grk_compress_get_recommended_data_type() after configuring compression and plugin state, then use its result when allocating component data. It returns GRK_INT_16 only when compression retains a 16-bit tile buffer.

For standard MCT, query all three components and use GRK_INT_32 for all three if any query returns it. GRK_INT_32 remains valid when the function recommends GRK_INT_16.

Multi-tile callers may still choose accepted GRK_INT_16 input outside the direct path to reduce source-buffer memory, at the cost of widening each tile.

Transcoding (grk_transcode)

grk_transcode rewrites JP2/J2K files at the packet level — no full decompression required. Supported operations:

  • Insert TLM (Tile-part Length) and PLT (Packet Length) markers for random access
  • Inject SOP / EPH markers
  • Truncate quality layers (--max-layers)
  • Strip resolution levels (--max-res)
  • Reorder packet progression (LRCP, RLCP, RPCL, PCRL, CPRL)

Example — add TLM + PLT markers to an existing file:

grk_transcode -i input.jp2 -o output.jp2 -X -L

Testing

  • 2,000+ unit tests
  • Continuous fuzzing via OSS-Fuzz

Language Bindings

  • Python, C#, Java (SWIG)
  • Rust (bindgen)

Links

  • Installation
  • Testing
  • Tile Cache Architecture
  • S3 / Cloud Storage
  • Language Bindings
  • Wiki & Docs
  • GitHub

Quick Build

git clone --recursive https://github.com/GrokImageCompression/grok.git
cd grok
cmake -B build
cmake --build build --parallel

About

World's Leading Open Source JPEG 2000 Codec

Topics

c-plus-pluscodeccompressionimageiso-iec-15444-15itu-t-t-814jpeg2000jpeg2000-part15lossless-image-compressionlossy-image-compressionwebassembly

Resources

Readme
License
Activity
Custom properties

Stars

299 stars

Watchers

15 watching

Forks

63 forks
Report repository

Releases

Sponsor this project

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.