ZMat: A MATLAB/Octave toolbox for zlib/gzip/lzma/lz4/zstd/blosc2 memory compression and base64 encoding
https://neurojson.org/wiki/index.cgi?keywords=registration&tool=zmat&ref=mathworks
You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
- Copyright: (C) 2019–2026 Qianqian Fang <q.fang at neu.edu>
- License: GNU General Public License v3 (GPL v3)
- URL: https://neurojson.org/zmat
- GitHub: https://github.com/NeuroJSON/zmat
- PyPI: https://pypi.org/project/zmat
- Acknowledgement: This project is part of the NeuroJSON project supported by US National Institutes of Health (NIH) grant U24-NS124027
- Please download zmat by filling out a brief registration form
- The pre-compiled Octave mex file can only be used with Octave 10+ on Windows and MacOS (on Linux, the Octave mex file supports all Octave versions). The MATLAB mex files can run across a wide range of MATLAB versions.
- Python binding — pip install zmat provides compress, decompress, encode,decode, and a low-level zmat interface; supports all compression methods(zlib, gzip, lzma, lzip, lz4, lz4hc, zstd, blosc2 variants, base64)
- NumPy array round-trip — compress(arr, info=True) returns an info dict;decompress(data, info=info) restores the original dtype, shape, and memory order(mirrors the MATLAB [ss,info]=zmat(arr) / zmat(ss,info) pattern)
- Octave 10+ compatibility — special matrix types (diagonal, permutation, etc.)are now handled correctly
- Apple Silicon support — the blosc2 backend now automatically detects SSE2availability on Apple Silicon (M-series) Macs
- New Linux MEX binaries — pre-compiled MEX files for Linux are now includedin the private folder alongside the existing macOS and Windows binaries
- macOS — .mex extension is now recognized so packages built against newerOctave run on older releases as well
- Project webpage — https://neurojson.org/zmat
- Fixed safety, memory, and efficiency issues throughout zmatlib.c
- Fixed memory leaks in easylzma (lloyd/easylzma#4, lloyd/easylzma#7, closes #11)
- Fixed missing header file causing build failures
- Static linking hardened for macOS (gcc-12) and Linux
- CI runners updated; added Ubuntu 24.04 and Apple Silicon (arm64) targets
- Windows MEX and Python wheel builds fixed for MSYS2/MinGW toolchain
Cite As
Qianqian Fang (2026). ZMat: a fast compression/decompression lib for MATALB/Octave (https://github.com/NeuroJSON/zmat), GitHub. Retrieved .
Acknowledgements
Inspired by: JSONLab: portable, robust JSON/binary-JSON encoder/decoder
Inspired: fNIRS SNIRF format reader/writer for MATLAB/Octave, JNIFTY - Tiny&Fast NIFTI-1/2 format reader/writer
General Information
- Version 1.0.0 (6.04 MB)
-
View License on GitHub
MATLAB Release Compatibility
- Compatible with R2008a and later releases
Platform Compatibility
- Windows
- macOS
- Linux
Versions that use the GitHub default branch cannot be downloaded
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.0.0 | -New Python Binding (https://pypi.org/project/zmat)
|
||
| 0.9.9.1 | Update tags, add registration link https://neurojson.org/wiki/index.cgi?keywords=registration&tool=zmat&ref=mathworks |
||
| 0.9.9 |
