r/compression • u/matildafae • 4h ago
How can I prevent so much compression when uploading?
r/compression • u/matildafae • 4h ago
r/compression • u/atoponce • 12h ago
r/compression • u/Apprehensive-Cup2844 • 7h ago
r/compression • u/Alcacholaruz • 2d ago
Hey everyone,
I originally built this compression algorithm for my own game engine because I wanted an open-source middle ground between LZ4 and Zstd for game dev workloads (paks, streaming assets, snapshots, small netcode packets). Full disclosure: I have background in network and low-level optimization, and I used AI to help me bridge the domain gap in compression itself while steering the architecture, profiling, and verifying everything on real hardware.
It turned out useful enough that I split it into a standalone zero-dependency library + CLI in both C11 and native Odin (100% wire-compatible, Apache-2.0, Linux/macOS/Windows):
https://github.com/JoseIgnacioAragon/axz
Quick numbers on the standard 202 MiB Silesia corpus (Intel Core 7 240H, AVX2, in-memory):
AXZ -1: 2.21x | 3.36 GiB/s 1T / 17.0 GiB/s 16T decodeAXZ -5: 2.90x | 3.24 GiB/s 1T / 17.0 GiB/s 16T decode (matches Zstd -1 ratio while decoding ~2x faster 1T and ~11x faster 16T, since standard Zstd frames don't parallelize decode)It's multi-core native in the wire format, skips bit-level Huffman/ANS in favor of SIMD planar tables, and includes 11 per-chunk pre-filters (RGBA8, Float4_Xor, Delta, SoA, etc.) plus 8-byte micro-packets + 8 KiB dictionaries for small RPC/netcode payloads. ARM64 NEON isn't in yet (runs scalar fallback for now), and -5 is intentionally slow to encode for offline asset cooking.
r/compression • u/Fickle_Option_1307 • 2d ago
Basically lz4 depending on the context the buffer memory changes. Is there a way where you can save the area of the hardware of algorithm and also increase the speed.
r/compression • u/Character-Intern8753 • 3d ago
r/compression • u/semenklenov • 3d ago
Film or digital? Vinyl or streaming? Beginners often hear these debates as matters of taste. Under the taste there is a precise piece of science: how a continuous signal from the real world becomes a list of numbers. My book covers both film and digital recording, and I think every visual artist should understand the step between them. In this article I explain it with two small experiments.
An analogue signal is continuous: the voltage from a microphone, the density of silver in film, the light falling on a sensor. It can take any value at any moment. A digital signal is a list of numbers. Getting from one to the other takes two separate steps, and each has its own error:
The sampling theorem, from Nyquist (1928) and Shannon (1949), says that a signal can be reconstructed exactly from its samples if it contains no frequencies above half the sampling rate. If it does, the high frequencies do not disappear. They fold back and pretend to be low frequencies. This is aliasing.
Experiment A. I sampled a 900 Hz tone at 1000 samples per second, below the required 1800. The spectrum of the samples shows a peak at exactly 100 Hz. The samples describe a slow wave that never existed (see the cover).
You know this effect from film: the "wagon-wheel effect", where spokes seem to turn backwards at 24 frames per second. In images it is moiré on fabrics and fine grids. Cameras fight it with an optical low-pass filter, and 3D renderers with anti-aliasing: several samples per pixel instead of one.
Every extra bit doubles the number of levels and lowers the rounding error. For a full-scale sine wave, theory predicts a signal-to-noise ratio of about 6.02 × N + 1.76 dB for N bits.
Experiment B. I quantised a sine wave to 4, 8, 12 and 16 bits and measured the real error:
| Bits | Levels | Measured SNR | Theory |
|---|---|---|---|
| 4 | 16 | 26.2 dB | 25.8 dB |
| 8 | 256 | 50.0 dB | 49.9 dB |
| 12 | 4,096 | 74.0 dB | 74.0 dB |
| 16 | 65,536 | 98.1 dB | 98.1 dB |
Every bit adds about 6 dB. That is why 8-bit images show banding in smooth skies and gradients, while 10-, 12- and 16-bit files and RAW photos give room to grade without stepping. It is also why masters for colour grading are kept at higher bit depth and converted to 8 bits only for delivery.
Not automatically. Analogue media have their own limits: film grain, tape hiss, generation loss with every copy. A digital system that samples fast enough and uses enough bits can exceed the useful precision of most analogue media, and it copies without loss. What people love in film is often real, though. It comes from grain structure, highlight roll-off and colour response, not from digital being "missing something". Many of these qualities can be measured and even modelled.
In SMART ONE, sampling and quantisation are where image analysis starts. Pixel grids, compression blocks and bit depth leave measurable patterns, and any honest analysis has to separate them from the content of the scene. In 3D work, aliasing is the reason to render with enough samples per pixel and keep textures at a resolution that matches their size on screen.
```python
import numpy as np
t = np.arange(220)/220; x = np.sin(2np.pi997.3*t)
for N in [4, 8, 12, 16]:
step = 2/2**N; q = np.round(x/step)*step
print(N, 10np.log10(np.mean(x***2)/np.mean((x-q)*2)), 6.02N + 1.76)
fs, f = 1000, 900; s = np.sin(2np.pif*np.arange(fs)/fs)
print("alias at", np.argmax(np.abs(np.fft.rfft(s))), "Hz")
```
SEMEN KLENOV · Visual science for beginners. Drafted with AI assistance; experiment code and numbers checked by the author.
---
Originally published at https://semenklenov.com/journal/analogue-vs-digital-signal/
r/compression • u/lowbercoder • 3d ago
Hi r/compression. I'm a solo developer in Nepal and I've been building a compressor called 3P (header-only C++17 engine, CLI, Windows GUI, .3p format). I'd like honest feedback from people who know this field, especially on whether my benchmarks are fair.
What it is: Its a Ai Driven context mixing file compression that does relatevely super good on jpg, right at the optimal boarderline of shannon's entropy limit It also does lossless recompression.
Results (3P v20.0 Max, 8 threads, round-trip verified on every run):
| Dataset | 3P Max | xz -6 | bzip2 -9 | zstd -9 |
|---|---|---|---|---|
| Canterbury (2.8 MB) | 390,523 | 485,828 | 568,890 | 593,615 |
| Silesia (212 MB) | 43,653,325 | 49,492,076 | 54,595,286 | 59,188,427 |
| enwik8 (100 MB) | 22,188,838 | 26,665,156 | 29,008,758 | 31,129,515 |
That's about 12% smaller than xz on Silesia and 17% smaller on enwik8.
The honest downsides:
Questions for you:
Willing to share benchmarks upon request, Test machine: Windows, Linux 1T core in recent version which is scalable, Happy to take criticism, since that's why I'm posting.

Sorry about not tagging the time in the benchmark, I will post the time in some other time, but here are the speed behcnmark mb/s for encdoing and decoding with single core for all three versions, You can test the compressor through this website http://3.106.223.177/
r/compression • u/lowbercoder • 3d ago
r/compression • u/sejbomznoru • 3d ago
Is there any compression utility that lets me losslessly shrink movies without re-encoding them? I have movies in mkv, 99% are blu-ray remuxes that are large in size and want to archive them on external drive. I tried archiving them in 7zip and winrar, which did basically nothing...
r/compression • u/abpolus2002 • 6d ago
Hi,
If we use my schema -> possibilities 01111111 128 10111111 64 11011111 32 11101111 16 11110111 8 11111011 4 and 1111110 1111111 (2). we could have in practice not theory same length of the message or shorter plus 8 bits to both messages that start with bit 1 and rest fill with bit 0 like 00000001.
What do you think, let me know.
r/compression • u/klanews • 7d ago
r/compression • u/Electrical_Ninja3805 • 8d ago
r/compression • u/atoponce • 9d ago
Reading the release notes, it sounds like Meta was initially planning on this coming out later, but a vulnerability leading to a CVE prompted them to push it out early.
r/compression • u/Agatsuma_Zenitsu_21 • 10d ago
Disclosure: I used AI assistance for development
I built Neuralzip, an open-source Python library for lossless text compression using a small neural model and arithmetic coding.
The model is trained on the input text. Its weights are stored alongside the encoded stream, metadata, and checksum in one archive. Decoding uses the saved model without retraining.
Results from two saved research models:
| Input | Original | gzip-9 | Neuralzip |
|---|---|---|---|
| 5 book collection | 3,120,899 B | 1,191,527 B | 791,134 B |
| Alice in Wonderland | 151,094 B | 53,249 B | 63,048 B |
The five-book archive is 33.6% smaller than gzip-9. Gzip wins on Alice, and PPMd produced a smaller five-book archive at 763,603 bytes.
Neuralzip sizes include the model weights and complete encoded stream. Shared decoder/runtime installation sizes are excluded. Both archives were decoded and compared with the original bytes.
Encoding requires training, decoding also evaluates the model, and both are much slower than conventional codecs. Small inputs can grow because of model overhead. These measurements use saved research checkpoints; fresh training runs can differ.
python -m pip install neuralzip
neuralzip encode notes.txt
neuralzip decode notes.txt.nzipI’d appreciate feedback on the archive accounting, implementation, and which datasets and baselines would make the next evaluation useful.
r/compression • u/IgorCv2 • 10d ago
Hi.
It's a listening test comparing the following MP3 encoders @ 192 kbps:
LAME 4.0 -V2
Helix -V110 -HF2
Ultra -V110 -HF2 -E1Z . https://github.com/IgorCv2/hmp3/releases/tag/ultra-poc1


r/compression • u/Cultural_Caramel_577 • 10d ago
r/compression • u/Lumpy_Moment_9168 • 10d ago
so I use my Meta glasses a lot with the amount of sports I play but I don't understand this:
How does such a short video (10-20s) take up the same amount of storage as an edited video (2:59s) I know Meta glasses/Phones might take videos at a high level of encoding but in reality its still 1080p so when I edit all of these videos together in CapCut (Theres enough to be said there so please dont roast me...) and then exported 1080p 3 minute video comes out to literally the same if not less storage on my disk I just dont understand how it works. I do understand that it reduces the quality of the videos a little bit but not astronmically enough bitrate wise to lower the storage by 2000%
And lastly, BECAUSE I have so many videos I'd LOVE to compress ALL of them this small so that they take up literally 10-20x less space on my phone/PC/Icloud photos (Preferably with keeping the dates/time the same, that way I know I can sort it based on date)
how is this 5s video ~20mb more than this 37s video
this 3 minute video is only double the size of the 5s video
r/compression • u/ramazanmelih1250 • 12d ago
Built a local Python + llama-cpp-python tool (runs 100% locally on an RTX 4060, not a hosted web service) to test 62-bit integer arithmetic coding using local GGUF language models as next-token predictors and verify exact SHA-256 round-trip decoding.
On this 560 B test text (US Constitution preamble + a fresh paragraph about information theory), zlib -9 gets 343 B, gpt2-large gets 62 B (0.886 bpb, 97.88% coder efficiency), and Qwen3.5-9B-Base gets 53 B (0.757 bpb, 97.81% efficiency).
The token-level -log2(P) heatmap makes pretraining memorization vs real generalization pretty obvious: the preamble is almost solid green for both models while the unseen second paragraph turns orange/red.
r/compression • u/doterax • 13d ago
You may remember Guetzli: Google's perceptual JPEG encoder from 2017. It makes JPEGs 20–30% smaller than libjpeg at the same visual quality. It does this by running Butteraugli, a model of the human eye, over and over until the eye stops complaining. It encodes at the speed of continental drift and eats about 300 MB of RAM per megapixel.
Some engineers at Tencent took pity on it and wrote CUDA and OpenCL backends. That's the hard part, and it's their work. I'm just a volunteer who adopted the fork after the original authors. I just shipped v3.0.0: https://github.com/doterax/guetzli-cuda-opencl
What happened:
Does the world need a faster encoder that is still about 1000× slower than mozjpeg? No. Did I enjoy chasing a float that differed in the last bit between CUDA and OpenCL? Also no. But it's done, and it's free.
Benchmarks, flames and "just use JPEG XL" comments are all welcome below 😂
UPD
Thanks for the questions. They were good enough that we stopped arguing and measured. Short version: you were right about jpegli.
Setup. Guetzli vs libjpeg-turbo 3.0.4, MozJPEG 4.1.5 and jpegli (libjxl 0.11.1) on 63 images: Kodak, real screenshots, rendered text/code/UI, line art and comics, photos with heavy grain, plus a set of production game art, game UI screenshots and drone photos. Each encoder's quality setting is swept. Each image gets the size each encoder needs to reach a target score, compared only where all four reach it. libjpeg-turbo and MozJPEG also get a 4:4:4 sweep, so their 4:2:0 default doesn't handicap them on text.
Three metrics: ssimulacra2, the current butteraugli from libjxl, and the 2017 butteraugli that Guetzli actually optimizes (the one behind Google's "20-30%").
"Jpegli will do almost the same instantly": it does better. At equal quality jpegli was the smallest on 57 of 58 images, about 14% below libjpeg-turbo at ssimulacra2 85. It wins even on Guetzli's own butteraugli (−23% vs −5% for Guetzli). And it runs at about 57 ms/MP, against 2.7 s/MP for Guetzli on our CUDA path (27 s/MP on CPU).
"How does the size compare to MozJPEG / jpegli?" Relative to libjpeg-turbo, at the same score:

(MozJPEG is tuned for mid quality; up here it loses to plain libjpeg-turbo, which matches what others have reported.)
"20-30% vs libjpeg isn't impressive / photo-tuned models fall apart on line art, text, grain / you'd need a large library": partly yes, partly no. Against a modern libjpeg-turbo with its best chroma mode, Guetzli's gain shrinks to about 5-10% on photos, and only on its own metric. On ssimulacra2 it's larger than libjpeg-turbo, and that gap is widest on screenshots and text (+9-40%). So Guetzli's advantage looks more like fitting one metric than a general improvement. jpegli's lead, though, held in every group: text, line art, game UI, aerial. The one group where it shrank was grain (4%), where every encoder struggles.








r/compression • u/Kind_Height_1913 • 14d ago
Full disclosure, since it matters for a tool that deletes files: the code was written by an AI (Claude, by Anthropic). The idea, design and hands-on testing are mine; I'm not a programmer and haven't reviewed the code line by line. That's why the design doesn't rely on trusting the code: nothing is deleted until it has been read back and verified, and the test suite kills the program at every stage of every kind of job (hundreds of scenarios) to prove it recovers. The tests, the source and a write-up of how it works are all on GitHub.
So Please - DO NOT USE THIS ON DATA THAT MATTERS AT ALL! I AM NOT RESPONSIBLE FOR ANY DATA LOSS!! I've used this on my own files so far (on things I'm okay losing - game installs, copies of files, etc.) and everything seems to work good on my end - I tried a few public zip tests and hashes matched too.
After I started using HatchZip, I thought it was such a good idea, but could we have a similar tool to zip files instead?
So the idea sprouted from the idea that compressing normally needs room for the files AND the archive at the same time. When a drive is nearly full, you can't compress the very things that are filling it. Same in reverse when unpacking a huge archive, and I wondered how can we use as little space as possible?
NibbleZip compresses a chunk, writes it to the archive, reads it back from disk, decompresses it and compares it byte for byte with the source, records it in a journal, and only then frees the space of that chunk of the originals. Big files are released from the inside as they go (NTFS sparse files), so free space actually rises while it works. Extraction does the reverse: the archive gives its space back as verified files come out.
In my own testing, a 29.5 GB game folder became a 9.7 GB 7z on a drive with about 32 GB free, without ever needing room for both.
- Normal 7z and ZIP output that 7-Zip, WinRAR etc. open. No custom format.
- Stop, crash or power cut: it resumes where it left off, or a half-processed file can be put back exactly as it was.
- One archive, one per item, or one per file (e.g. a ROM folder where every game becomes its own zip), and split parts (.001, .002...).
- Untick one box and it's an ordinary archiver that deletes nothing.
Again, this is a beta. Please try it on copies of data first. I'd love reports of anything odd: different drives (exFAT, USB, network), huge file counts, very large single files, archives made by other tools.
GitHub (source, download, how it works): https://github.com/cloudhaacker/NibbleZip
VirusTotal scan of the release: https://www.virustotal.com/gui/file/a4bfb46971d3b5b0151b3a31ea26aa5a4aa3b02c57e17888e65f32c7e8d2f0b2?nocache=1
For some reason I'm getting flagged by Kaspersky - VHO:Rootkit.Win32.Convagent.gen - Acronis (Static ML) - Undetected
If you don't trust my builds, you can analyze the code yourself and build it, my last version didn't pop this so I'm pretty sure it's a false positive.
I'm open to suggestions, and will listen to any constructive feedback, but I won't guarantee how long things might take to fix/change - I just started making this for fun and to see what Claude could do with this. Thanks for checking it out, and if you can think of somewhere else it might be good to post, let me know or share with others! Thanks!
Free, MIT licence, no telemetry, nothing to install.
r/compression • u/Sure_Resource4753 • 14d ago
GPU JPEG decoders are fast, but their pixels differ from the CPU libraries'. On 102 public test images, nvJPEG matched libjpeg-turbo on none of them, by up to 110 levels at 4:2:0. That quietly breaks reproducible ML pipelines, test baselines and caches whenever decoding moves between CPU and GPU.
exact-gpu-jpeg decodes on the GPU and returns libjpeg-turbo's pixels byte for byte (accurate IDCT, fancy upsampling), and its encoder writes the same bytes as Pillow. Anything it can't reproduce exactly, progressive files for example, goes to libjpeg-turbo itself, so the output is always the reference.
On a 2016 GTX 1070: a 30 MP camera photo decodes in 11.3 ms, against 185 ms for libjpeg-turbo on one core and 164 ms for nvJPEG on the same card. Batches of small images: 7,310 images/s. Encoding: 5.5x faster than Pillow with identical files.
Where it loses is listed near the top of the README: one small image at a time, small encodes against 8 CPU threads, progressive files. Everything so far is from one machine, so results from other GPUs are very welcome: `python bench/reproduce.py --quick`, and there's a pinned issue for them.
The parallel Huffman stage (Weißenberger & Schmidt's self-synchronising method) is drawn in docs/huffman-sync.md, and there's a white paper in docs/ covering the method, the evidence and the limits.
r/compression • u/gkotorlis • 16d ago
ctLame 0.3.0 is a C++ port of LAME 4.0's VBR encoder (-V) that encodes a single file on all cores and writes exactly the same bytes as lame.exe.
On an i9-11900K (8C/16T) it encoded 45 h of CD audio (-V 4) in 85 s; lame.exe took 1195 s. All 343 files were bit-identical.
LAME is sequential by design: psychoacoustic state carries from frame to frame, and so does the bit reservoir. ctLame splits each frame into stateless parts (FFT, MDCT, quantization search, Huffman), which run for many frames in parallel, and short serial steps in frame order.
It's the successor to fpMP3Enc (2008): https://hydrogenaudio.org/index.php/topic,73790.msg649414.html
How it's built: https://www.thinkmeta.com/concurrenttasks/task-based-programming/ctlame
Source (LGPL), binaries for Windows/Linux x64, benchmarks: https://github.com/ThinkMeta-com/ThinkMeta.ConcurrentTasks.Samples/tree/main/ctLame
Numbers from other CPUs welcome.
r/compression • u/AdvancedMessage462 • 15d ago
Hi!
I’m not a pioneer in this field - you can find both free and commercial projects on the internet (https://github.com/adimalkar/Neural-Image-Compressor , https://ai.nero.com/image-compressor).
Some time ago I shared my neural image codec here https://github.com/ageMLex2021/oxn and got fair criticism :PSNR alone is not enough, and I needed to compare against JPEGXL and AVif. So I did the homework. Setup: Kodak kodim21-24 (these 4 images were never used in training), matched bitrates 0.15-0.30 bpp, metrics PSNR, MS-SSIM and LPIPS, plus encode/decode times. Full tables, methodology and a visual crop comparison: https://github.com/ageMLex2021/oxn/blob/main/BENCHMARKS.md

Short version of what I found: