Click here to Skip to main content
15,889,600 members
Everything / General Programming / Compression

Compression

compression

Great Reads

by Patrice T
RLE (Run Length Encoding): The Human Friendly Compression
by Michael Haephrati
The MakeCab tool is built-in in Windows but using it to create a .cab archive is a bit tricky. Why not write a small program that will do that for you?
by Jovan Popovic(MSFT)
In this article, you will see how to compress data in SQL Server using GZip algorithm and send it via node.js to browser.
by Serge Berlin
.NET Library for in-memory GZip and LZMA compression combined with strong BlakeB based stream cipher engine

Latest Articles

by Jeffrey T. Fritz
Azure Storage Caching and Compression
by Patrice T
RLE (Run Length Encoding): The Human Friendly Compression
by RegularJoe5150
A reformulation of compressed pair into a type list
by Serge Berlin
.NET Library for in-memory GZip and LZMA compression combined with strong BlakeB based stream cipher engine

All Articles

Sort by Updated

Compression 

6 Jan 2023 by Lones
Hello everyone, Im trying to create my own data compressor and decompressor I saw some posts here and I tried to change them but there is a problem. Let's say I created a file trial.txt program compressing it but adding a lot of 00 00 00 00...
2 Jan 2023 by Jeffrey T. Fritz
Azure Storage Caching and Compression
16 Apr 2022 by Patrice T
RLE (Run Length Encoding): The Human Friendly Compression
22 Dec 2021 by k5054
Look at this: int count; /* assign a value to count */ char Message[count]; /* creates a buffer of size count */ /* ... a bit later */ unsigned CompressedSize = sizeof(Message)*7/8; Creating an array on the stack with a size determined at...
28 Aug 2021 by RegularJoe5150
A reformulation of compressed pair into a type list
11 Jun 2021 by Member 15040038
I saw on a video on YouTube that an image was hidden inside an image. Not the steganographically way but, opening the image on 7zip or other software and a picture file or any other file inside the original image. Does anyone know how this was...
11 Jun 2021 by RickZeeland
See: How To Hide Files In a JPG Picture[^]
10 Jun 2020 by Member 10610788
Im having trouble coming up with a way too decompress a string in java, this is a basic java class im taking so it only requires basic commands, nothing too fancy. The objective it to able to type C:\>java Compress -c aaaabbbbbcc in the command prompt and it will print a4b5c2 (like it is...
25 Apr 2020 by Member 12223678
hello everyone I've been trying to come up with a way to condense (compress) a large string that only contains numberis it possible to combining each couple of numbers and represent them in 8 bits instead of having each character take up the entire octet Here is my input...
13 Jun 2019 by MAU787
hi all i have one function which generates string that string is very lengthy. i want to decrease its length and size this is my code and result: not posting real string it is very long protected void Page_Load(object sender, EventArgs e) { string txt = "somestring"; ...
13 Jun 2019 by OriginalGriff
That's not the compression, that's Base64. Base64 takes a string of byte values (which can hold 256 different values) and converts it to a "text friendly" version that can be transfered via text-only protocols like JSON, XML, and HTML. It does that by storing 6 bits of the first byte in the...
1 Jan 2019 by Serge Berlin
.NET Library for in-memory GZip and LZMA compression combined with strong BlakeB based stream cipher engine
5 Nov 2018 by johannesnestler
Depend's how you use it, but Maybe this helps: ETW Trace Compression (and xperf syntax refresher) | Random ASCII[^]
5 Nov 2018 by nairnishitha
We are logging custom events from application to ETW. Now need to find the best compression technique as lots of data will be written to the file and the etl file is to be send with error report to the server. How to specify the details? In System.Diagnostics.Tracing.EventSource itself, when...
24 Aug 2018 by Michael Haephrati
The MakeCab tool is built-in in Windows but using it to create a .cab archive is a bit tricky. Why not write a small program that will do that for you?
20 Aug 2018 by Patrice T
Quote: This algorithm compresses the image to 100 KB. No, this code do not compress the image to given size, it downscale the image. The reduced size is only a secondary effect. Quote: I'm trying to find an image compression algorithm You are not looking for a compression algorithm jpeg images...
20 Aug 2018 by Member 13955667
I'm trying to find an image compression algorithm in the Swift programming language, as in the WhatsApp messenger. In the programming language Java under OS Android I found quickly, and under the platform iOS have difficulties. Here is the image compression algorithm for Android: public...
24 May 2018 by Patrice T
Quote: Is it possible to create software like Pied Piper from HBO's Silicon Valley? Short reasonable answer: No, it is fictional. Read this: Is the compression algorithm shown in Silicon Valley possible in reality? - Quora[^] In theory, an incredible breakthrough is always possible but very...
24 May 2018 by Mehdi Gholam
As a general rule, don't believe all you see on TV, most of what is shown is exaggerated for dramatic purposes and not correct. Like Richard Deeming commented, compression uses the information content or entropy (the degree of randomness) of the data input to create an output with the maximum...
24 May 2018 by CPallini
Generally speaking the answer is no, you can't. However, in particular cases you might achieve even higher compression ratios. Please note video compression is lossy most of the time.,
8 May 2018 by MacOwl
I have an old application that stored images (scanned B&W pages) in a large binary file. I have worked out how to single out the individual pages, but I can't decipher the binary for each page. As far as I know, the original pages were TIFF images. The resulting binary is also 1/16th the size,...
30 Apr 2018 by Rick York
The function takes a pointer to the input buffer so you have to provide that. So, given the name of a file and the fact that you have to provide a buffer of data, the next step would be to read the file into a buffer of data. What I would do is determine how big the file is, allocate a memory...
30 Apr 2018 by Member 13803981
This is what manual says: Syntax:   outsize = Huffman_Compress(in,out,insize)   outsize Size of output buffer after compression in Pointer to the input buffer (uncompressed data) out Pointer to the output buffer (compressed data) insize Size of input buffer The output buffer must be able to...
13 Feb 2018 by RickZeeland
Found this at: How do I reduce the number of data points in a series? - Cross Validated[^] Quote: calculate the distance between two points with a formula like d=sqrt((time1-time2)^2 + (bpm1-bpm2)). You set a minimum distance in your program. Then you iterate through your data and after every...
13 Feb 2018 by Member 13420508
I am trying to learn about Interpolation compression but I couldn't find any example or algorithm for interpolation compression. Can any one help me to get an idea about interpolation compression. Thanks. What I have tried: I have read couple research publications which are available on google.
9 Feb 2018 by RickZeeland
Maybe Kalman filtering might be of interest to you: Kalman filtering demo[^]
18 Dec 2017 by RamdhanSTO
so i try to compress video using LZW method, and the result is none. anyone can help please? i really appreciated it. thanks. What I have tried: search it at google/google scholar using any similar LZW method (txt/pic)
18 Dec 2017 by Patrice T
Quote: anyone can help please? No, nobody can help you in such a forum. The reason why everyone do not have its own video converter is because it is complicated and well above the level of beginners. Each of these topics are worth books: LZW compression, video file formats, mp4 file format and...
23 Jul 2017 by Member 13324712
hi did you resolved above issue ?
26 Mar 2017 by Member 11405465
I'm working on an application which transfers huge data from server (Web API) to client (JavaScript) which takes some time over the network. So we decided to go with compression in server and decompression in client. I have used Zlib for .NET to compress my file. Below is the code which I have...
2 Aug 2016 by Member 12637902
1. Encode each pixel’s color into a string: -a. Start with the top left pixel. -b. Write the color of the pixel in hexcode (#rrggbb). -c. If there is pixel to the right of the current pixel, move onto that pixel. Otherwise, move to the leftmost pixel of the next row. Either way, continue...
2 Aug 2016 by CPallini
Suggested reading: Run-length encoding - Wikipedia, the free encyclopedia[^].
5 Jun 2016 by David_Pollard
OK,I think I have come up with a workaround solution.The RFC822_msg column that I'm trying to decode is actually a FileStream column.That is to say it is a varbinary(max) column with FileStream enabled and the actual data is stored directly in the NTFS file system outside of the...
2 Jun 2016 by David_Pollard
Hi Guys,I have a string of hex characters in a column on my SQL Server.Each row in the database is a backup of an email from my Exchange server.One column is basically the entire contents of an email. I need to decoded the hex back into readable characters so I can perform other...
31 May 2016 by OriginalGriff
Use SQL to do it: DECOMPRESS (Transact-SQL)[^] - since it compressed it, the safest way to decompress it is to get it to do it...
20 Apr 2016 by Tomas Takac
This is not the right forum, please ask here:Compressed Sensing Intro & Tutorial w/ Matlab - Add a Comment or Question[^]
18 Apr 2016 by TaruMeenal
Is there any open source Video Compressing app or software which compress the Video and save it to any storage like cloud parallelly while taking that video from a Phone or Tab cameraWhat I have tried:I have Tried Some Spy Apps Like Mobile Hidden Camera ,Spy camera OS, But some are not...
18 Apr 2016 by TaruMeenal
Found one app :Ivideon.Its similar to what my requirement is.
11 Apr 2016 by mj01001
hiI wanted to ask few question about filesFor example mp3 fileWhen read as a binary array of bytesFor this I use algorithms to reduce the size of the byte array to a string or char would later become serious difficulties for his return or not?Because if I use the Hoffman algorithm(for...
11 Apr 2016 by OriginalGriff
That code doesn't compress anything!Partly because it writes the input data to the output stream instead of the byteOut data, and partly because even if it did, byteOut contains the same data as byteArray anyway...If you want to compress data in C#, then look at the GZipStream Class...
9 Apr 2016 by Prakash1206
there are a lot of questions asked regarding opencv + H.264 but none of them gave detailed explanation.i am using openh264(openh264-1.4.0-win32msvc.dll) along with opencv 3.1(custom build with cmake having ffmpeg enabled) in visual studio, i wanted to save video coming from webcam in mp4...
27 Feb 2016 by Arvind Gehlot
Use of HTTP Compression on ASP.NET / MVC pages using IIS or Server side code
11 Jan 2016 by Milliarde
Get started understanding compressed sensing (CS) with some simple code-based examples!
9 Jan 2016 by OriginalGriff
I assume you are talking about this article: LZW Compression Algorithm Implemented in Java[^] - if so, the original author does not appear to be active anymore, and since teh articel was written in 2006...You could try this: LZW data compression-decompression algorithm java code Java[^]...
9 Jan 2016 by Member 12231802
i got an lzw compression source code from code project and it works can i get the decompression code of the same?
5 Jan 2016 by Member 12223678
unsigned int i; const char *s = "123465789"; vector num; for (i=0;i
4 Jan 2016 by KarstenK
if you are REALLY SURE, that it will only be decimal numbers you can go as easy as this: char digit1 = sample[i]; int value1 = digit1 - '0'; //is between 0 and 9 char digit0 = sample[i+1]; int value0 = digit0 - '0'; //is between 0 and 9 int number = value1 * 10 + value0; ...
31 Dec 2015 by bling
Abstraction.You need an abstraction layer between the code and the actual data (file or memory). You'll need to write two implementations of this abstraction layer - one for a file and the other for memory. Your comments state the need for random access so this layer will need to support...
26 Dec 2015 by Member 11869825
Dear friends, I am trying to implement a program that reconstructs a binary file, starting from the old file and a file of differences. The work is based on the ingenious thesis Olin Percival, Naive differences of executable code, http://www.daemonology.net/bsdiff/ , 2003. I want to use the...
11 Dec 2015 by Jovan Popovic(MSFT)
In this article, you will see how to compress data in SQL Server using GZip algorithm and send it via node.js to browser.
2 Oct 2015 by anil_kumar_bhakta
Dear All,I am going to plan for backup tool. I have tested some of the built-in libraries like from SharpZip,DotNetZip etc. But i observed that DotNetZip has limitation of 4GB filesize. Our requirement is to compress files & folders which are more than 100GB in size.Another experiment...
17 Aug 2015 by Dave Kreskowiak
Possible, yes, BUT... It depends entirely on what's in the files and the compression algorithm used. If they're nothing but text files, you might be able to get 90% out of it. If it's a bunch of JPG files, not a chance. The files are already compressed about as much as is going to be possible.
27 Jul 2015 by Sergey Alexandrovich Kryukov
It on the algorithm and the data to be compressed as well, especially in case of lossy compression. The use of "frequent values" is just the technique used only in some, often most primitive algorithms, such as run-length encoding (https://en.wikipedia.org/wiki/Run-length_encoding[^]). The...
27 Jul 2015 by OriginalGriff
Oh, boy...This is a complicated subject: far, far beyond what we can discuss in a little text box.So start here: https://en.wikipedia.org/wiki/Data_compression[^]Then begin reading some of these: Google[^]We can answer specific questions - but we can't explain a huge subject like...
27 Jul 2015 by BijoyJoseph
There are many compression algorithms available and in general these algorithms take the frequent values from a file which has to be compressed and keeps a count of it. Okay, so what are these values exactly? are these the bytes (I think most files are represented in Hexadecimal form for ease of...
20 Jul 2015 by Sergey Alexandrovich Kryukov
You can find an answer here: http://stackoverflow.com/questions/18079754/convert-and-display-image-from-byte-array[^].—SA
7 Jul 2015 by Ordiales
If a Zip file has his origin in Linux or Mac. ZipArchive class can fail trying to return Entries Collection
17 May 2015 by tejas.chudasama
Dear team am facing issue from last one week .server configuration windows server 2012 R2, intel xeon processor, 8GB Ram, 500Gb HDD IIS 8.5 am facing issue from last one week .issue is on client browser all file compressing only one file not compress .aspx in server...
15 Mar 2015 by manchanx
1) replace your if-else-cascade in void fa_z(FILE *fp) with a switch-statement.2) replace the switch-statement in void fa_z(FILE *fp) with an array or dictionary* and no case-distinction at all.3) sort the result of void fa_z(FILE *fp) by frequency.4) build a huffman-tree from the...
15 Mar 2015 by George Jonsson
You can start with replacing the while loop in void fa_z(FILE *fp) withint index = 0;while ((c = fgetc(fp)) != EOF){ if (c >= 'a' && c
15 Mar 2015 by Member 11410794
data compression pro#include#include#include#includevoid fsize(FILE *fp);void fcal(FILE *fp);void fa_z(FILE *fp);char r;long char c;void main(){ FILE *fp; clrscr(); fp=fopen("file name.txt","r"); ...
25 Feb 2015 by RON LAVEZI
what i am looking for an example program written in C++ for compression and decompression(encoder and decoder modules)and test it on text files and multimedia files i want with this code to prove the important of Kraft inequality, Shannon codes, and Huffman codes and at the end i want the...
25 Feb 2015 by Sergey Alexandrovich Kryukov
You can use famous open-source 7-zip which implements different algorithms, including ZIP:http://en.wikipedia.org/wiki/7-Zip[^],http://www.7-zip.org/[^],http://sourceforge.net/projects/sevenzip[^],http://sourceforge.net/projects/sevenzip/files[^].—SA
25 Feb 2015 by phil.o
Your question seems a little weird. You are talking about Kraft inequality, Shannon & Huffman codes, so you seem to already have some knowledge in algorithmics in general, and in compression algorithms specifically. So why don't you just try?My only source when it comes to dealing with .zip...
17 Dec 2014 by Brad Joss
SQL CLR Functions for Zip Compression and Regular Expression evaluations
4 Dec 2014 by Mehdi Gholam
Read the documentation here : http://nodejs.org/api/zlib.html[^]
4 Dec 2014 by Joseph Regis
Hi, We are receiving a compressed binary from service which i need to decompress to "utf8 string" using gzip or any other format in node.js. How we can do this?. Note that compression happened using zlib. Thanks in advance.
28 Nov 2014 by Sergey Alexandrovich Kryukov
This is not a correctly posed question. More exactly, there is no a problem with that.Compression has nothing to do with languages. However, compression ratio does depend on the content of the data. You can only compare blocks of data of the same size in bytes. If you compress the block, the...
28 Nov 2014 by Member 11199376
hey all i have a problem with my graduation projectits arabic language compression/decompressioni have done some compression algorithm i found it up here which output's a binary array to the compressed text , i've been thinking can i use lzw binary compression to maximize my output...
23 Oct 2014 by Rasik Banta
I am writing a client to consume an asmx web service which has gzip encoding enabled. I am trying to view the response in Fiddler.The strange thing is that it doesn't work in my server but works in another server which is in a different network.I have googled but couldn't find any...
9 Jul 2014 by Anton Koekemoer
I will not give you the code, but will try to guide you in the right direction.This seems to be a simple RLE type compression, so decompression is very simple.You need to understand what the compress method does, once you do this, the decompress should be obvious.The compress will scan...
28 May 2014 by Rob Philpott
This *could* be to do with 64 bit extensions. If it works without password protection then this isn't the problem.It is however a common problem that if you use the latest version of SharpZipLib, Windows XP can't understand the format and claims the file is corrupt. Afraid I don't know...
28 May 2014 by ravikhoda
Hi all,i am generating a zip file using sharp zip lib in c# window application. this zip file is password protected. now i want to unzip this file using the mini zip library on ios7 but when i try to extract it using the password it show bad or corrupted file in the ios. however if i...
5 Dec 2013 by Tharaka MTR
How to automate PNG and JPG image optimization
7 Nov 2013 by Mehdi Gholam
Start here : https://github.com/icsharpcode/SharpZipLib/wiki/GZip-and-Tar-Samples#wiki-createTGZ[^]
7 Nov 2013 by sudeep23
I want to download a folder by compressing it to .tar extension.I have use the ICSharpCode.SharpZipLib.Tar to compress. But it is not working. My code is below.Please help me out..ASAPprivate void CreateTar(string outputTarFilename, string sourceDirectory) { ...
4 Sep 2013 by mccaber82
I am using the Kinect SDK to capture an RGB stream. I am capturing the data at: ColorImageFormat.RawBayerResolution640x480Fps30More info on available formats here. I want to store this stream on disk, so I am using a binary writer to write the raw frame bytes of the color image. This...
4 Sep 2013 by mccaber82
I have an image coming from a web cam. Its coming in at 640px width, 480px height, format of PixelFormats.Brg32.I am writing the image to disk as the frames arrive but unfortunately its far to large (I use binaryWriter to do this). To save on space, I've decided to use compression to...
21 Jun 2013 by Terry Neckar
I have a file that is used by an archived program that the source no longer exists. I'm working on expanding the function of that program but in doing so have many files that I need to know their format. I have one that is compressed but I can't find any compression formats that fit it. If...
20 Jun 2013 by AlphaDeltaTheta
Pack200 and "deflate" are the only ones that are supported in java out-of-the-box. Though you can write a Classloader that reads from other archive format such as BZip2 or 7z (LZMA), it requires to be present in a start-up stub applet, that contains the Classloader, downloads the archive...
17 Jun 2013 by David Alejandro Garcia Garcia
Hello, i have a big application, i launch my app from the web using a jnlp file, and pack200 to compress it, and download faster. But since my app is getting bigger (about 35-45mb), some times pack200 just hang out, or some times, the jnlp downloader hang out, is there an alternative better to...
28 May 2013 by khurram_shahzad
i Found the point that stopping compression when im accessing application from users PC (not from inside the application server). the issue was that browser has proxy configured so tomcat compression was not working through proxy.i found this by testing the compression directly on server and...
28 May 2013 by CHill60
First thing to check ... So you've installed tomcat on your local machine ... have you installed it on the client machine? Make sure that it's on there - enabling the compression and installing the tomcat server are not the same thing.If you still have issues then post a question to the...
27 May 2013 by khurram_shahzad
Hi Everyone,I'm facing some issue in configuring compression on tomcat7, scenario is that i'm working on client site where i've to turn on the compression on server on tomcat7. so what i've found the way to do this is to modify ...\tomcat7.0\conf\server.xml file and add some line to enable the...
18 May 2013 by Abhishek Kumar Goswami
This tip compares GZIP compression facility provided by Java and .NET.
12 Apr 2013 by Abhinav S
You can use the GZipStream class[^].Examples -http://www.dotnetperls.com/gzipstream[^]GZipStream - Compress/Decompress a string[^]
12 Apr 2013 by shahcool143
Hello Sir/Madem,I want to GZip Compression in Asp.net for css/js files.how to apply GZIP compression for it.is Gzip compress confilct with ajax component ??
21 Mar 2013 by Matthew Faithfull
There are two things here, working with data compression and working with C++. To crack data compression you'll nee to understand the mathematics and algorithms at least reasonably well from a theoretical point of view, in other words on paper. A quick search tells me I might start somewhere...
21 Mar 2013 by Saurabh.Garg
I used this one for my C++ projects:Zip Utils - clean, elegant, simple, C++/Win32[^]-Saurabh
21 Mar 2013 by Alamgirable
Where is the best place to start working with data compression in c++.I want to compress data ontwo endpoints on one endpoint i want to compress data and on other i want decompress.Please help me.
19 Mar 2013 by Zoltán Zörgő
If you want to send images over network and you don't want TCP because of it's overhead or other limitations, you can use of course UDP. But: UDP is not reliable, and as you noticed, you might encounter several problems if you want to send large files (that need to remain consistent)....
19 Mar 2013 by Dave Kreskowiak
You can turn a bitmap into an array of bytes with this: ' You can use your own bitmap object. This one is just for illustration. Dim myBitmap As New Bitmap(1280, 1024, PixelFormat.Format32bppArgb) ' Create a Rectangle object the size of the entire bitmap. ...
19 Mar 2013 by Dave Kreskowiak
Why are you converting an image to Base64 in the first place?? Surely it can't be to think you'll get less data to send?? You're actually making MORE data to send, not less by doing this conversion. A screenshot at 1280x1024 results in just over 5.12MB of data. The Base64 string of this data...
18 Mar 2013 by Prasad Khandekar
Hello,How about using System.IO.Compression.GZipStream class. The example of using this class can be found here[^] in MSDN library. There is one more example available here[^].Regards,
18 Mar 2013 by Rixterz123
Hey againI have made a program that turns an image into a base64 string and sends via UDP.the problem is that i get an error when the base64 is too largeHow do you compress this on the host side and then decompress back into a base64 string on the client side?Help is appreciated.
15 Mar 2013 by Sergey Alexandrovich Kryukov
You will find all you need here: http://en.wikipedia.org/wiki/Huffman_coding[^].See also the referenced to examples in this article.Now, the question is not quite correct: the algorithm is abstracted from the content you want to compress. But it makes some sense, because a linked list is...
15 Mar 2013 by shobhitbhalla
hi can anybody tell me how to compress a link list data in c language through huffman encodng technique ?
19 Feb 2013 by Menno van Leeuwen
I solved the question after a bit of help from Sergey Alexandrovich Kryukov.He said that JAR Files are the same as ZIP so I used this code to extract my JAR.Dim cur As String = (Environment.CurrentDirectory) Dim MC_JAR As String = install_path.Text & "\bin\minecraft.jar" ...
19 Feb 2013 by Sergey Alexandrovich Kryukov
JAR file is actually ZIP. If your question is just about compressing, you can use one of the two open-source solutions:You can use #ziplib:http://www.icsharpcode.net/opensource/sharpziplib/[^].Another option is using SevenZipSharp, a .NET wrapper of the famous...
19 Feb 2013 by Menno van Leeuwen
Hello I got a short questionHow do I extract a JAR file with visual basic 2010And how do I compress one?