Questions tagged [lossless-compression]

Lossless data compression is a class of data compression algorithms that allows the original data to be perfectly reconstructed from the compressed data.

Lossless data compression is used in many applications. For example, it is used in the ZIP file format and in the GNU tool gzip. It is also often used as a component within lossy data compression technologies (e.g. lossless mid/side joint stereo preprocessing by the LAME MP3 encoder and other lossy audio encoders).

178 questions
76
votes
4 answers

Is JPEG lossless when quality is set to 100?

I understand that JPEG is a lossy compression standard, and that the 'quality' factor controls the degree of compression and thus the amount of data loss. But when the quality number is set to 100, is the resulting jpeg lossless?
Sugrue
  • 3,265
  • 4
  • 30
  • 51
60
votes
3 answers

Why does base64-encoded data compress so poorly?

I was recently compressing some files, and I noticed that base64-encoded data seems to compress really bad. Here is one example: Original file: 429,7 MiB compress via xz -9: 13,2 MiB / 429,7 MiB = 0,031 4,9 MiB/s 1:28 base64 it and compress via xz…
Stefan Seidel
  • 5,440
  • 2
  • 16
  • 18
52
votes
8 answers

h264 lossless coding

Is it possible to do completely lossless encoding in h264? By lossless, I mean that if I feed it a series of frames and encode them, and then if I extract all the frames from the encoded video, I will get the exact same frames as in the input, pixel…
cloudraven
  • 2,349
  • 1
  • 22
  • 44
42
votes
7 answers

String compression in JavaScript

I'm looking for a JavaScript function that given a string returns a compressed (shorter) string. I'm developing a Chrome web application that saves long strings (HTML) to a local database. For testing purposes I tried to zip the file storing the…
Bambax
  • 2,562
  • 6
  • 29
  • 41
41
votes
1 answer

Difference: LZ77 vs. LZ4 vs. LZ4HC (compression algorithms)?

I understand the LZ77 and LZ78 algorithms. I read about LZ4 here and here and found code for it. Those links described the LZ4 block format. But it would be great if someone could explain (or direct me to some resource explaining): How LZ4 is…
ghost204nit
  • 554
  • 1
  • 5
  • 12
35
votes
5 answers

Write a program that takes text as input and produces a program that reproduces that text

Recently I came across one nice problem, which turned up as simple to understand as hard to find any way to solve. The problem is: Write a program, that reads a text from input and prints some other program on output. If we compile and run the…
31
votes
3 answers

What is the current state of text-only compression algorithms?

In honor of the Hutter Prize, what are the top algorithms (and a quick description of each) for text compression? Note: The intent of this question is to get a description of compression algorithms, not of compression programs.
Brian R. Bondy
  • 314,085
  • 114
  • 576
  • 619
24
votes
6 answers

Compress numpy arrays efficiently

I tried various methods to do data compression when saving to disk some numpy arrays. These 1D arrays contain sampled data at a certain sampling rate (can be sound recorded with a microphone, or any other measurment with any sensor) : the data is…
Basj
  • 29,668
  • 65
  • 241
  • 451
23
votes
3 answers

Losslessly compressing images on django

I'm doing optimization and Google recommends Lossless compression to images, looking for a way to implement this in Django. Here's the images they specified, I think for it to be done effectively it needs to implemented systemwide possibly using a…
user4910881
17
votes
4 answers

Comparison between lz4 vs lz4_hc vs blosc vs snappy vs fastlz

I have a large file of size 500 mb to compress in a minute with the best possible compression ratio. I have found out these algorithms to be suitable for my use. lz4 lz4_hc snappy quicklz blosc Can someone give a comparison of speed and…
Sayantan Ghosh
  • 744
  • 2
  • 7
  • 23
10
votes
3 answers

Data Compression : Arithmetic coding unclear

Can anyone please explain arithmetic encoding for data compression with implementation details ? I have surfed through internet and found mark nelson's post but the implementation's technique is indeed unclear to me after trying for many hours. Mark…
Abhishek
  • 488
  • 1
  • 6
  • 18
9
votes
2 answers

Library for further (lossless) Jpeg-compression

I'm looking for a library specialized at compressing Jpegs even further without changing the image. I've found PackJpeg but it doesn't provide any source code and you're not allowed to use it commercially.
Yrlec
  • 3,223
  • 6
  • 35
  • 72
9
votes
2 answers

Lossless RGB to Y'CbCr transformation

I am trying to losslessly compress an image, and in order to take advantage of regularities, I want to convert the image from RGB to Y'CbCr. (The exact details of what I mean by RGB and Y'CbCr are not important here; the RGB data consists of three…
Ruud
  • 2,901
  • 2
  • 35
  • 44
8
votes
1 answer

Matches overlapping lookahead on LZ77/LZSS with suffix trees

Background: I have an implementation of a generic LZSS backend on C++ (available here. The matching algorithm I use in this version is exceedingly simple, because it was originally meant to compress relatively small files (at most 64kB) for…
8
votes
0 answers

Removing both leading and trailing silence from m4a files using ffmpeg

I have an audio file which has both leading and trailing silence and with the following specifics: Codec: MPEG AAC Audio (mp4a) Channels: Stereo Sample rate: 44100 Hz Bitrate: 253 kbps I want to remove the silences AND keep the quality intact. So…
Tejas Shah
  • 1,141
  • 8
  • 17
1
2 3
11 12