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
이 제출물을 팔로우합니다
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다
ZMat 1.0.0 — "Foxy the Fantastic Mr. Fox"
Release date: 2026-04-15
- 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
Download
- 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.
Highlights
ZMat reaches its first stable release after seven years of development. This release adds a Python binding, updates all bundled compression libraries to their latest versions, and fixes long-standing memory and safety issues in the core C library.
New Features
- 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
Bug Fixes
- 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
Build & CI
- 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
Acknowledgement
AI coding assistant Claude has been used in the development of this release.
Quick StartMATLAB / Octave
% Compress and decompress a numeric array (restoring size and type)
orig = single(rand(5));
[compressed, info] = zmat(orig, 1, 'lzma');
restored = zmat(compressed, info);
% Base64 encode and decode a string
encoded = zmat('zmat toolbox', 1, 'base64');
decoded = char(zmat(encoded, 0, 'base64'));
Python Examples
import numpy as np
import zmat
# Compress and decompress bytes
data = b"hello zmat"
compressed = zmat.compress(data, method='zlib')
restored = zmat.decompress(compressed, method='zlib')
# NumPy array round-trip (preserves dtype, shape, memory order)
arr = np.random.rand(4, 5).astype(np.float32)
compressed, info = zmat.compress(arr, method='lz4', info=True)
restored = zmat.decompress(compressed, info=info)
# Base64 encoding
encoded = zmat.encode(b"zmat toolbox", method='base64')
decoded = zmat.decode(encoded, method='base64')
C Examples
#include "zmatlib.h"
#include <string.h>
#include <stdlib.h>
int main(void) {
const char *input = "hello zmat";
unsigned char *compressed = NULL, *decompressed = NULL;
size_t complen = 0, decomplen = 0;
int status = 0;
union TZMatFlags flags = {1}; /* 1 = compress */
/* compress */
zmat_run(strlen(input), (unsigned char *)input,
&complen, &compressed, zmZlib, &status, flags.iscompress);
/* decompress */
flags.iscompress = 0;
zmat_run(complen, compressed,
&decomplen, &decompressed, zmZlib, &status, flags.iscompress);
free(compressed);
free(decompressed);
return 0;
}
Link with: -lzmat -lz -lpthread
Full Changelog
인용 양식
Qianqian Fang (2026). ZMat: a fast compression/decompression lib for MATALB/Octave (https://github.com/NeuroJSON/zmat), GitHub. 검색 날짜: .
일반 정보
- 버전 1.0.0 (6.09 MB)
-
GitHub에서 라이선스 보기
MATLAB 릴리스 호환 정보
- R2008a 이상 릴리스와 호환
플랫폼 호환성
- Windows
- macOS
- Linux
GitHub 디폴트 브랜치를 사용하는 버전은 다운로드할 수 없음
| 버전 | 퍼블리시됨 | 릴리스 정보 | 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 |
이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.
이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.
