Compress numpy arrays efficiently
What I do now: import gzip import numpy f = gzip.GzipFile(“my_array.npy.gz”, “w”) numpy.save(file=f, arr=my_array) f.close()
What I do now: import gzip import numpy f = gzip.GzipFile(“my_array.npy.gz”, “w”) numpy.save(file=f, arr=my_array) f.close()
I am going to add a late answer to this one after spending all day trying to figure out how to get YUV 4:4:4 pixels into x264. While x264 does accept raw 4:2:0 pixels in a file, it is really quite difficult getting 4:4:4 pixels passed in. With recent versions of ffmpeg, the following works … Read more
I just released a small LZW implementation especially tailored for this very purpose as none of the existing implementations did meet my needs. Here is the home page of the project Here is a link to a demo comparing it with LZMA level 1 That’s what I’m using going forward, and I will probably try … Read more
As correctly answered above, using a “typical” JPEG encoder at quality 100 does not give you lossless compression. Lossless JPEG encoding exists, but it’s different in nature and seldom used. I’m just posting to say why quality 100 does not mean lossless. In JPEG compression information is mostly lost during the DCT coefficient quantization step … Read more