Releases: EmilDohne/compressed-image
v1.0.1
v1.0.0
compressed-image 1.0.0
The first stable release of compressed-image is now available. This C++20 header-only library (with pip-installable Python bindings) provides efficient, losslessly compressed in-memory image storage. It’s designed to reduce memory usage significantly while maintaining fast access and processing speeds.
Key Features
- Store image data as compressed buffers with support for lz4, zstd, blosclz, and others
- Random-access decompression at the chunk level
- Lazy image/channel structures with minimal memory overhead
- Cross-platform support: Linux, Windows, macOS
- Python bindings with NumPy compatibility
When to Use It
Use compressed-image when you need to keep many images in memory without paying the cost of uncompressed storage. Ideal for high-resolution image pipelines, datasets that don’t fit in RAM, and applications that require partial decompression or fast random access to image data.
Performance
In benchmarks, compressed-image achieves similar or better performance than traditional libraries like OpenImageIO, while using significantly less memory. Full details and graphs are available in the documentation.
Example Usage
C++
auto image = compressed::image<uint8_t>::read("/some/file/path");
auto channel_r = image.channel("R");
for (auto chunk : channel_r) {
std::for_each(std::execution::par_unseq, chunk.begin(), chunk.end(), [](auto& px) {
// process pixel
});
}Python
import compressed_image as compressed
image = compressed.Image.read(np.float16, "/some/file/path")
channel_r = image[0]
for idx in range(channel_r.num_chunks()):
chunk = channel_r.get_chunk(idx)
# process and set back
channel_r.set_chunk(chunk, idx)Documentation
Full documentation is available at compressed-image.readthedocs.io, including API details and benchmarks.