Using the PNG algorithm to save a .mat file

조회 수: 1 (최근 30일)
Ghady Hajj
Ghady Hajj 2018년 11월 16일
답변: Guillaume 2018년 11월 16일
Hello,
I have a (382x486) matrix and I want to save it in a compressed form. If I save this matrix as a png image I get a very good compression (compared to the original matrix saved in .mat format alone). I am wondering if there is someway that I can use the algorithm used in PNG to compress the file in .mat format.
Thank you.

답변 (2개)

Image Analyst
Image Analyst 2018년 11월 16일
It does not look like it according to the help. It just uses some internal compression scheme and you have no control over that except to turn it off completely. But with an image that tiny, why do you even care?

Guillaume
Guillaume 2018년 11월 16일
The compression method that PNG uses is the well established deflate algorithm. This is the same algorithm that gzip uses and is also the most commonly used compression method used by zip, both of which are standard matlab functions.
The most commonly used library implementation is zlib for which precompiled dll are available. This could be used in matlab via loadlibrary if you wanted to compress something that is not a file. If you want to make your life easy, use gzip.

카테고리

Help CenterFile Exchange에서 Denoising and Compression에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by