Questions tagged [compression]

The name given to the process of encoding data such that it uses lesser number of bits as compared to the original representation.

There are a number of techniques to compress information, with most algorithms working to compress image, speech, music or video. Encoding the same information in lesser bits results in saving some crucial resource such as transmission bandwidth or hard-disk space. Compression algorithms also take advantage of human perception to further reduce the size of information. By encoding the same piece of information with fewer bits in places that the human brain is not accustomed to perceiving as well as other parts, substantial gains in compression ratios can be achieved.

9175 questions
4
votes
4 answers

Compressing unix timestamps with microseconds accuracy

I have file that consists of a sequence of real time unix timestamps with microsecond accuracy, i.e. the timestamps can never decrease. All the timestamps that need to be coded/decoded are from the same day. A sample entry in the file might be…
learner
  • 123
  • 2
  • 11
4
votes
2 answers

What is best way to compress file and text "inside browser" before sending to server?

Actually I trying to upload large text and pdf files. I want to compress file chunks in browser only. So i can encrypt and send these lite chunk through ajax smoothly without hanging browser. I am seeking help related to file chunk compression. And…
Jeet
  • 185
  • 1
  • 2
  • 10
4
votes
1 answer

Javascript Client Side JPEG image compression

I want to basically compress images uploaded (client-side) and then attach the src to my id (of html). The code of the function is as below: function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); …
Vaibhav Magon
  • 1,453
  • 1
  • 13
  • 29
4
votes
1 answer

LZH in Byte Array Decompress in .NET?

An LZH archive is embedded within a file. The file was read into a byte[], and the LZH part is identified as a smaller byte[]. How can the embedded LZH bytes be decompressed into another byte[] using .NET Framework 4.6 (C#)? I have only see…
Snowy
  • 5,942
  • 19
  • 65
  • 119
4
votes
4 answers

PPMD compression in Java?

Does anyone know of a Java implementation of the PPMD compression algorithm? I have not been able to find a Java implementation, but there is a C# implementation at http://users.senet.com.au/~mjbone/Compression.html that is about 4k lines of code.…
rud200
  • 41
  • 1
  • 4
4
votes
1 answer

How to dump compressed strings in json?

I've a string that I'm compressing using zlib, storing it in a dictionary and creating a md5 hash of the dictionary. But I'm getting the error: UnicodeDecodeError: 'utf8' codec can't decode byte 0x9c in position 1: invalid start byte The code…
Rahul
  • 3,208
  • 8
  • 38
  • 68
4
votes
3 answers

Java Compression Library To Support Deflate64

Looking for an alternative compression java library to Apache Commons Compress (https://commons.apache.org/proper/commons-compress/). Commons Compress throws an error when trying to read a zip entry that was compressed using "ENHANCED_DEFLATED"…
cjablonski76
  • 173
  • 1
  • 13
4
votes
1 answer

Log and compress the output of subprocess.call

I want to redirect the output of subprocess.call(...) to a xz- or bzip2-compressed file. I tried : with lzma.open(log_path, "x") as log_file: subprocess.call(command, stdout=log_file, stderr=log_file) but the resulting file isn't a valid…
Hey
  • 1,701
  • 5
  • 23
  • 43
4
votes
1 answer

ZipArchive returning empty files c#

So I have achieved zipping the files but now I am having this another issues that the zip folder contains empty file. The size of the file zipped is 0 bytes. This is how I am zipping my file try { var outPutDirectory =…
mohsinali1317
  • 4,255
  • 9
  • 46
  • 85
4
votes
1 answer

Elasticsearch remove default fields from search's response body

Im doing a query that returns like 70k documents (I need all of them, and Im currently using scan & scroll) What happens is that the response is very large (2 MB and we alredy reduced it from 6 MB). We alredy filtered the fields we needed, and since…
Pablo Morelli
  • 123
  • 3
  • 8
4
votes
2 answers

decompress deflate64

I've got a compressed string of bytes coming out of a database which I need to decompress so as to retrieve the rtf file in there. This is the requirement. I tried to use DotNetZip and it has given me a 50% success ratio. The failed 50% gave me a…
Joe
  • 11,147
  • 7
  • 49
  • 60
4
votes
1 answer

LZW compression algorithm implementation

I have been reading dictionary based compression algorithms including LZW and LZSS. Then, I wanted to implement LZW using Java and started working on it. I am not a developer and so I suspect my implementation may not be efficient. Can you look at…
birraa
  • 430
  • 1
  • 4
  • 15
4
votes
1 answer

Python 2.7 pyLZMA works, Python 3.4 LZMA module does not

import sys import os import zlib try: import pylzma as lzma except ImportError: import lzma from io import StringIO import…
hedgehog90
  • 1,402
  • 19
  • 37
4
votes
2 answers

Parallelization and H.264 (or probably any compression codec)? Why's it so hard?

My limited (and probably wrong?) understanding of video compression is that intra-frames are completely independent. In other words, all the picture data for a intra frame (key frame) is stored in its entirety for that frame. It's the following…
4
votes
2 answers

How to reduce the size of video in Android?

I am new to Android .I don't know how to compress the video in android . Please, suggest me the options?