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.
192
questions
1
vote
1
answer
101
views
Looking for help simplifying a general purpose compression function
The following is a general purpose file compression function with the following features:
It can take either a single file or directory as the source input
It defaults to the source directory when to ...
0
votes
1
answer
87
views
Comparing video recording algorithms in Java: no-compression vs. naive diff compressor
Usage of the program is in Facebook.
Intro
In this JavaFX program, a user is presented with a white canvas with a black circle at the center of the canvas. Then, the user has 10 seconds to record a ...
5
votes
1
answer
295
views
Most compact data format for a shopping cart
I'm trying to build a format that can represent the user's cart on my website in the most compact way. The website is related to computer parts and there are 23 product categories. Each product has an ...
3
votes
2
answers
1k
views
Huffman Coding implementation in C++
Here is an implementation of compression with Huffman coding. It works well by my testing. It compresses a 1 GB string in about 30 seconds, and decompresses in about 15 seconds with VisualStudio 2022 &...
1
vote
1
answer
80
views
Optimal Jelly string compressor in Rust
I'm writing some small programs to practice Rust, and this one's a string compressor for the golfing language Jelly (unofficial spec). It involves some non-ASCII stuff and bigints (from the ...
4
votes
1
answer
283
views
Python script for zlib decompression
I'm looking for feedback/improvement on code that I wrote. It's a function that scans a file for zlib headers and returns the header, offset, and decompressed data. In main, below the function, I use ...
6
votes
2
answers
994
views
Huffman coding, using vector<bool>
This is my draft implementation of Huffman encoding & decoding. I'd appreciate any feedback, but have a couple specific questions:
I wrote the code assuming vector represents each bool with a ...
3
votes
1
answer
468
views
Huffman coding implementation in java
I wrote a simple huffman coding algorithm for learning and practice. I just used the technique given on the wikipedia page.
Could you tell me my missing points and mistakes?
Node.java
...
7
votes
1
answer
3k
views
Decompress tar.gz file in Go
I want to extract tar.gz file and store the contents in the same directory. I got below method which does the job but I wanted to see if there is any way to improve ...
1
vote
0
answers
37
views
Generic Huffman Encoding
For my first Rust exercise I decided to re-implement a project I wrote in C++ for my data structures class a few years ago, plus make it generic. I am looking for all suggestions, but I am primarily ...
1
vote
3
answers
160
views
Run-length coder
I have this code, which counts only adjacent letters in a string and returns the count of each letter.
...
4
votes
2
answers
329
views
Linux backup script written in bash for tar
This is my first attempt at scripting with bash. I am running Ubuntu server, so I don't get to use all the gui back ups out there. Besides, tar works fine for personal use. Please let me know of any ...
1
vote
2
answers
95
views
Huffman compressor in plain C
I recently picked up C, because I am getting tired of the hell that is Java Enterprise development.
I decided that writing a Huffman compressor will be a great little exercise, and I have always ...
2
votes
2
answers
425
views
Numeronym generation
Problem statement
I need to generate numeronyms from a string, let's say qwerty as follows:
qwerty
q1erty
q2rty
q3ty
q4y
Code
...
8
votes
2
answers
385
views
Huffman encoding bitcodes display
So, the concept of the code is simple. Take any file, read the binary character counts and construct a Huffman tree, and then output the bit code of each character (displayed as its 8-bit value).
This ...
2
votes
2
answers
507
views
Priority queue implementation on C. (For Huffman Coding)
I trying to implement Huffman Codes on C. And, since my previous attempt failed, I decided to approach the issue more responsibly. So I'm asking for feedback on my implementation of the priority queue ...
3
votes
0
answers
201
views
SevenZipCompressor Utility class that uses Commons-Compress to compress and uncompress 7zip archives
I wrote a Compressor utility class to generate 7zip files containing everything in a specific directory. The problem is that it's an order of magnitude slower than both archiving the directory using ...
3
votes
2
answers
220
views
Slow Huffman Code in pure Python
I was working on writing a fast implementation of a simple Huffman code compression of text. The idea was to write it using only the standard library, but I can't seem to find a way to make it faster. ...
6
votes
1
answer
1k
views
LZ77 compressor and decompressor in C++
I've written working LZ77 algorithm implementation which uses linked lists (they help to look for matching substrings faster). I'd like to get some feedback on my code's quality and also information ...
4
votes
1
answer
570
views
LZW Compression Library
I wrote a library that implements LZW compression and decompression. A goal of this project was to help me acquaint myself with modern C++ development practices (I primarily come from a Java ...
11
votes
2
answers
2k
views
Huffman encoding
The Huffman-Algorithm
The Huffman-Algorithm, named after David A. Huffman who first published this algorithm in 1952, is a algorithm for lossless data compression. As most encoding-methods, the words ...
4
votes
1
answer
341
views
Huffman encoding as Unix style command line utility
After watching Tom Scott explain Huffman coding in this YouTube video, I wanted to implement it myself. I want to use this project to further my understanding of Python. Additionally this tool should ...
4
votes
0
answers
84
views
Fast compression using a thread pool
This is my latest effort on RFC 1951 compression ( the widely-supported compression standard ) in Rust. It uses 2 extra threads to compute the LZ77 matches and the checksum in parallel with the ...
1
vote
0
answers
48
views
RFC 1951 "Inflate" (de-compression)
My exploration of Rust continues. I'm quite pleased with the 2-step table lookup for decoding variable bit-length codes here, for some reason I found this tricky to work out, but now it's done I like ...
10
votes
3
answers
2k
views
Compression Library for C using Huffman Coding
This is an update to a question I posed nearly two years ago about my implementation of Huffman Coding which I had written in C. Since then I have had time to grow as a programmer and have managed to ...
2
votes
0
answers
160
views
LZ77 Encoding and Decoding in Haskell
I am trying to learn Haskell and figured I would kill two birds with one stone and also learn about data compression. My ultimate goal is to implement the DEFLATE compression algorithm in Haskell. To ...
7
votes
0
answers
82
views
Feedback on LZSS implementation
Recently, I've been trying to get back into Haskell, so I tried coding up a LZSS implementation. I realize this is much more easily implemented imperatively, but I wanted to challenge myself. The last ...
3
votes
2
answers
256
views
Huffman Encoding in Javascript
So, I've implemented Huffman Encoding in JavaScript, you can see it live here. Here is the code:
...
2
votes
0
answers
266
views
How can I make my LZ77 algorithm to compress faster or to compress more?
So, I am trying to create a PNG compression library, and to do that I need to use the DEFLATE algorithm; DEFLATE consists of two parts, the LZ77 compression, and the Huffman Compression. Currently, my ...
1
vote
0
answers
14
views
Compressing and encrypting file systems for backups
I am currently backing up remote OS' while preserving the permissions using rsync:
rsync -aAX --numeric-ids --delete ... [email protected]:/ /backup/server/
Now I ...
3
votes
0
answers
190
views
Doing image compression with Neural Network AutoEncoders
I wanted to create an image compressor using Machine Learning and started work on an "AutoEncoder". This is a type of Neural Network which takes in the image and creates a compressed vector form.
It ...
4
votes
1
answer
74
views
Minimalist context compressor
I am working on an implementation of the minimalist compression method.
The method is based on context modeling, followed by a simple entropy coder (Golomb-Rice coder).
The context model uses a single ...
5
votes
1
answer
164
views
Minimalist Golomb-Rice coder
I have implemented a very simple but robust implementation of the Golomb-Rice coding.
To understand my motivation, see the minimalist data compressor that is based on this.
At the moment, the ...
6
votes
2
answers
272
views
Compressing large jpeg images
I'm working with thousands of large image files in a regularly updated library. The following script does the job (on average reduces my file size ~95%) but costs me around 25 seconds to compress one ...
4
votes
0
answers
83
views
Powershell optimization (scripts to run simultaneously)
I need some help here, I posted on stackoverflow and was directed here, just to put things in context, I am new to PowerShell, I have a task, that in simple terms, would take a csv with more than ...
7
votes
1
answer
2k
views
LZ77 compression algorithm (general code efficiency)
I'm implementing LZ77 compression algorithm. To compress any file type, I use its binary representation and then read it as chars (because 1 ...
8
votes
1
answer
471
views
Brainfuck compressor in Python
Just for fun, I created a script called TinyBF which can compress Brainfuck programs into a format half their size. For example, take a famous hello world program clocking in at 78 bytes:
...
8
votes
1
answer
1k
views
LZ77 compression (also longest string match)
So, I'm implementing LZ77 compression algorithm. To compress any file type, I use its binary representation and then read it as chars (because 1 ...
7
votes
1
answer
344
views
Loading BitmapImages out of a Zip file
I'm working on a personal project to get better with C#, and as part of that I have a zip file with 20 or so images saved inside. I want to load those images out of the zip file and display them in my ...
5
votes
3
answers
162
views
File compression project
I wrote a general purpose file compression program out of curiosity, but I am concerned about readability. I don't know if the variable names are useful, and whether most of the comments are unneeded ...
3
votes
1
answer
81
views
File compressor
I have written a file compressor in python. The program generates a file filled with sequences of the same character with a random length, and compresses that file. I would like feedback on code ...
2
votes
2
answers
3k
views
Run length encoding in C#
This is the original question:
https://www.geeksforgeeks.org/run-length-encoding/
Given an input string, write a function that returns the Run Length
Encoded string for the input string. For ...
2
votes
0
answers
102
views
Google drive backup robot
I have a lot of files. I care about those files. I also care about good programming practices and learning proper python. Given the described context, it seemed appropriate to implement my own ...
0
votes
1
answer
47
views
Uncompressing a list with some run-length-encoded elements
Regarding the following code
...
3
votes
1
answer
103
views
Print a string of characters with their occurrences
I have worked out a solution for this problem, however I am trying to reach an O(1) solution without the use of two for loops. The output should read as a3b2c4d1 ...
4
votes
1
answer
294
views
First Huffman Compression Algorithm in C++
I decided to take up learning c++ recently, so I coded a Huffman compression algorithm. I'm particularly interested in critique of my c++ techniques (pointers, references, best practices, etc), but I ...
6
votes
3
answers
6k
views
Huffman Code in C++
This is my version of the Huffman Codes.
...
4
votes
2
answers
882
views
WPF Bitmap / BitmapFrame to multi-page / multi-frame TIFF with JPEG encoding
I was searching for a long time how to write multi-page TIFFs with the JPEG encoding. TIFFs support JPEG encoded frames but the built-in encoder in .NET Framework does not have JPEG as a compression ...
5
votes
2
answers
154
views
Using two threads to increase RFC1951 Deflate compression performance
I have modified my implementation of RFC 1951 "Deflate" compression to use two threads. One thread performs the LZ77 matching, looking for sequences of at least three bytes that occur earlier in the ...
1
vote
2
answers
129
views
Optimised code to compute Huffman codes when implementing RFC 1951
I found a trick to significantly reduce the time needed to compute Huffman codes in my implementation of RFC1951. I was slightly surprised to find it slightly improves compression as well, something ...