Kompression mit zip: Grundlagen, Optionen und Beispiele

zip ist das universellste Archivierungs- und Kompressionswerkzeug, das unter Linux, Windows und macOS funktioniert. Es kombiniert Archivierung und Kompression in einem Schritt und kann Ordner direkt verarbeiten – im Gegensatz zu gzip, bzip2 und xz. Ideal für plattformübergreifenden Dateiaustausch. Wichtige Optionen von zip -r : Rekursiv: Komprimiert Ordner und alle Unterordner (einzigartig bei zip). zip -r backup.zip ordner/ -d oder unzip : Entpackt eine .zip-Datei. unzip ist ein […]

https://andreas-moor.de/kompression-mit-zip-grundlagen-optionen-und-beispiele/

Kompression mit gzip: Grundlagen, Optionen und Beispiele

gzip ist eines der meistgenutzten Kompressionswerkzeuge unter Linux, das einzelne Dateien mit dem schnellen DEFLATE-Algorithmus komprimiert. Es ist besonders nützlich für alltägliche Kompressionsaufgaben, bei denen Geschwindigkeit wichtiger ist als maximale Speicherersparnis. Wichtige Optionen von gzip -k : Originaldatei nach Kompression behalten. Standardmäßig entfernt gzip die Eingabedatei nach Kompression. gzip -k datei.txt -d oder gunzip (Alias): Dekomprimiert eine .gz-Datei. […]

https://andreas-moor.de/kompression-mit-gzip-grundlagen-optionen-und-beispiele/

🎈 Ah, the timeless quest to understand #Deflate by manually decoding a #GZIP file—because clearly, using a computer to do what it's designed for is just too mainstream. 🤓 Meanwhile, Wikipedia does all the heavy lifting, turning an exercise in #compression into an exercise in redundancy. 📜💥
https://jjrscott.com/to-deflate-or-not/ #ManualDecoding #HackerNews #WikipediaRedundancy #HackerNews #ngated
Understanding Deflate

A very simple worked example

jjrscott
Understanding Deflate

A very simple worked example

jjrscott
🌘 剖析 Deflate 壓縮演算法
➤ 從 Gzip 壓縮字串到手動解碼 Deflate 的技術解析
https://jjrscott.com/to-deflate-or-not/
本文作者深入剖析 Deflate 壓縮演算法的運作原理,透過手動解碼一段 Gzip 壓縮的字串,展示如何將原始資料轉換為壓縮後的位元流,並進一步解析其中包含的 LZ77 複製指令與 Huffman 編碼。雖然作者成功將 24 位元組的字串壓縮至約 16 位元組,但此過程也凸顯了手動解碼的複雜性。
+ 作者的實踐方法非常直觀,讓我對 Deflate 的內部機制有了更清晰的認識。不過手動解碼確實很花時間!
+ 這篇分析真是太棒了,對於想深入瞭解壓縮技術的開發者來說是絕佳的資源。希望未來能看到更多類似的技術拆解。
#壓縮演算法 #Deflate #Gzip #LZ77 #Huffman 編碼
Understanding Deflate

A very simple worked example

jjrscott
Gzip - GNU Project - Free Software Foundation

It is remarkable how little the internet knows about parallel #deflate #compression The best guide on how to do it can be found in a massive comment in the pigz source code.

It's not really that hard once you realise that you can concatenate streams as long as they're flushed (synced to byte boundaries): https://github.com/any1/neatvnc/blob/master/src/parallel-deflate.c

I didn't set the dictionary for each chunk, but it doesn't seem to make a big difference.

neatvnc/src/parallel-deflate.c at master · any1/neatvnc

A liberally licensed VNC server library with a clean interface - any1/neatvnc

GitHub

[Перевод] Разбираем самый маленький PNG в мире

Самый миниатюрный PNG в мире весит 67 байт и представляет собой один чёрный пиксель. Выше вы видите его в 200-кратном увеличении. Красота, не так ли? Состоит этот файл из четырёх частей: Сигнатура PNG, одинаковая во всех файлах этого формата: 8 байт. Метаданные изображения, включая его размеры: 25 байт. Данные пикселя: 22 байта. Маркер «конец изображения»: 12 байт. Далее я опишу этот файл подробнее и постараюсь объяснить принцип работы формата PNG. В качестве небольшой затравки скажу, что в конце предстоит неожиданный поворот. Хотя, надеюсь, вам и без того интересно побольше узнать о PNG.

https://habr.com/ru/companies/ruvds/articles/787302/

#ruvds_перевод #png #сжатие_изображений #обработка_изображений #deflate #структура_png

Разбираем самый маленький PNG в мире

Самый миниатюрный PNG в мире весит 67 байт и представляет собой один чёрный пиксель. Выше вы видите его в 200-кратном увеличении. Красота, не так ли? Состоит этот файл из четырёх частей: Сигнатура...

Хабр

@alcinnz
The reference I would look to for #DEFLATE (#PNG) compression would be #opticl ; while it's lovely #lisp native, I think the implementation of #DEFLATE includes non-portable (in some sense) hardware acceleration to speed up de/compression. https://github.com/slyrus/opticl

I believe #opticl is used by #mcclim ansi #clim2 implementation, for example. #commonLisp. Even if you're not working in lisp, lisp is natural to absorb ideas from.
@vertigo

GitHub - slyrus/opticl: An image processing library for Common Lisp

An image processing library for Common Lisp. Contribute to slyrus/opticl development by creating an account on GitHub.

GitHub

[Перевод] Распаковываем архив gzip вручную. Часть 2

В этой части мы, как и в первой , разархивируем файл gzip вручную, но теперь ещё и декодируем коды Хаффмана. Для начала запишем данные на диск: $ echo "hector the frantic father on an anchor or a rare fat cat sat on the ranch" > test-huff.txt
$ xxd test-huff.txt
00000000: 6865 6374 6f72 2074 6865 2066 7261 6e74 hector the frant
00000010: 6963 2066 6174 6865 7220 6f6e 2061 6e20 ic father on an
00000020: 616e 6368 6f72 206f 7220 6120 7261 7265 anchor or a rare
00000030: 2066 6174 2063 6174 2073 6174 206f 6e20 fat cat sat on
00000040: 7468 6520 7261 6e63 680a the ranch. На этот раз файл получился размером 74 байта и содержит 13 символов: a, c, e, f, h, i, n, o, r, s, t; пробел (0x20) и перевод каретки (0x0a). В этой строке есть много повторений. Надеюсь, gzip это учтёт. Поскольку я работаю под Windows, то для распаковки использовал 7zip-zstd . $ 7z a -mx9 test-huff.txt.gz .\test-huff.txt
$ xxd test-huff.txt.gz
00000000: 1f8b 0808 d76f 6565 0200 7465 7374 2d68 .....oee..test-h
00000010: 7566 662e 7478 7400 158b 410a 0031 0c02 uff.txt...A..1..
00000020: effb 0abf 2621 257b 69c1 e6ff d480 1e64 ....&!%{i......d
00000030: c6ca e823 7425 96b8 fb0f 2c7a 0967 8393 ...#t%....,z.g..
00000040: 2873 8710 9543 11ee 75ad cc51 237d 0fc7 (s...C..u..Q#}..
00000050: 9797 d64a 0000 00 ...J... Чтобы вы лучше поняли, как будет выглядеть декодирование, покажу первую строку декодированного потока gzip: 0101 1001 0001 1101 00111 010 000 1101 0101 1001 000
h e c t o r ' ' t h e ' ' Ну а подробности читайте далее.

https://habr.com/ru/companies/ruvds/articles/783210/

#ruvds_перевод #gzip #архивирование_данных #clojure #deflate #коды_хаффмана

Распаковываем архив gzip вручную. Часть 2

В этой части мы, как и в первой , разархивируем файл gzip вручную, но теперь ещё и декодируем коды Хаффмана. Для начала запишем данные на диск: $ echo "hector the frantic father on an anchor or...

Хабр