24 votes
Accepted

What's purpose of the new function BinarySerialize?

Disclaimer: This answer is written from a user's point of view. For useful insider information on this topic see this discussion with Mathematica developers on Community Forums. Introduction Binary ...
Ray Shadow's user avatar
  • 7,826
17 votes
Accepted

How to uncompress strings safely (without any evaluation)?

This is definitely a bug. Here's a slightly simpler workaround than those suggested in the comments: Uncompress[str, HoldComplete] // InputForm Generally ...
Itai Seggev's user avatar
  • 14.1k
11 votes
Accepted

Efficient way to storage large lists in a file(s)

Using ByteCount will tell you to expect more than 1 GB: ByteCount @ { alist, blist, clist } (* 1 136 880 448 *) Compress I ...
gwr's user avatar
  • 13.5k
10 votes

Import ZIP file options broken in Mathematica 12.2.0

Unfortunately this is indeed a bug and it's fixed for the next version. The workaround is to use ExtractArchive first, then ...
GenericAccountName's user avatar
10 votes
Accepted

How to zip folders

This can be achieved with Map (/@). 1) Identify the folders you want to compress: ...
ktm's user avatar
  • 4,242
10 votes

How to correctly import data zipped with the "deflate" algorithm?

A simple, efficient, but undocumented way to use zlib deflate algorithm in Mathematica is to utilize the functions ...
Ray Shadow's user avatar
  • 7,826
10 votes
Accepted

Is there a way to create ZIP OutputStream ?

As mentioned already it's easy to implement this functionality with JLink. But once you use Java's ZipOtputStream you will need to convert your data to list of ...
BlacKow's user avatar
  • 6,428
9 votes

How does - represent compressed data?

The - is not a character but actually an Image. It is a very clever trick that was used. Each pixel in the image represents an ascii character after a transformation. Let's review how this image was ...
Zviovich's user avatar
  • 9,308
7 votes

What's purpose of the new function BinarySerialize?

Measure the difference in bytes with ByteCount. BinarySerialize[Range[100]] // ByteCount ...
Edmund's user avatar
  • 42.3k
7 votes
Accepted

How to store data in a Mma SE question using hidden html-like markup?

Store data in question Tables could be left in plain text, with some encoding to remove CR and LF characters and other symbols. ...
rhermans's user avatar
  • 36.5k
6 votes

How to compress a string in Mathematica so that it can decompressed in python

I'm not familiar with your application nor your reason to remove spaces for passing arguments in the command-line interface. You will see two examples which in both of them a string successfully ...
Ben Izd's user avatar
  • 9,249
6 votes
Accepted

Iconize a compressed image

Update @andre mentions that an alternative to the two step procedures in my original answer is to convert the image to a byte array directly using ExportByteArray. ...
Carl Woll's user avatar
  • 131k
6 votes
Accepted

Support for low-complexity (compressible) lists

No, I do not believe there is built-in functionality for the data form you describe. However Interpolation comes close. Here's an example. ...
Mr.Wizard's user avatar
  • 272k
6 votes

What's purpose of the new function BinarySerialize?

Here's an interesting complement to Edmund's answer. It's not always the case that the ByteArray form will be more compact. ...
b3m2a1's user avatar
  • 46.9k
6 votes

Is there a way to create ZIP OutputStream ?

Neither the import format ZIP (nor any of those similar to it like GZIP, TAR or BZIP) nor the function CreateArchive do have any documented functionality which ...
Albert Retey's user avatar
  • 23.6k
5 votes
Accepted

A weird issue with Interval[$MaxNumber]

A new and mostly rewritten version of the original answer which was flawed. See edit history if interested. As any operation making $MaxNumber higher (more ...
The Vee's user avatar
  • 1,790
5 votes
Accepted

How to deal with zip files in the wolfram cloud?

This works for me: ...
Rolf Mertig's user avatar
  • 17.2k
4 votes
Accepted

Compression results in unpacking of integers but not reals

There is an undocumented Method option to Compress that you can use to control this. A packed integer array: ...
Carl Woll's user avatar
  • 131k
4 votes
Accepted

Optimized GIF 20s for 85kb for Mathematica Code Demonstration

Personally, I use ScreenToGif, which is very easy to use and results in very small files without a lot of work. It can even upload the images directly to Imgur. I tried to recreate the GIF you linked, ...
Lukas Lang's user avatar
4 votes

How can I compress DICOM images?

Export "ZIP" As explained by @Szabolcs, "GZIP" will not accept more than one file, so here I show an example ...
rhermans's user avatar
  • 36.5k
4 votes

Support for low-complexity (compressible) lists

{First[#], Length[#]}& /@ Split[{17, 17, 17, 17, 17, 21, 21, 21, 21, 21, 21, 21, 21, 11, 11, 11, 11, 11, 11, 11}] (* {{17, 5}, {21, 8}, {11, 7}} *) <...
David G. Stork's user avatar
3 votes

Compressing TIFF figure with constant resolution

Using your code to generate the f image, then specify an image encoding when you export as TIFF, e.g. ZIP: ...
MarcoB's user avatar
  • 67.2k
3 votes

Support for low-complexity (compressible) lists

Transform unique numbers to digits base n (length of unique numbers) Transform original list to digits base n Construct an integer from the list of it's digits base n Using integer instead of a list ...
webcpu's user avatar
  • 3,182
3 votes
Accepted

Decoding GZIP encoded Body, BodyBytes (ByteArray) and BodyBytesArray from URLRead

"BodyBytes" a list of bytes from http response. Does not mean much without encoding information "BodyByteArray" afaict <...
Kuba's user avatar
  • 137k
3 votes

What's purpose of the new function BinarySerialize?

In general, serialization is widely used for two purposes: To send large objects "over the wire" by TCP/IP from one computer to another. For example, a company might have a programming object such ...
CElliott's user avatar
  • 560
3 votes
Accepted

Import CSV data from internet to mathematica

Just download and unzip the CSV file and then run: data = Import["path/to/ICIO2018_2015.CSV"]; Dimensions[data] {2552, 2876}
Sjoerd Smit's user avatar
  • 23.5k
1 vote

How to deal with zip files in the wolfram cloud?

c = CloudPut[a, Permissions -> "Public"] simply puts the file path(an expresstion) of the archived file and not the actual archived contents. So you need to use <...
dsingh's user avatar
  • 669
1 vote

DataEncoding and compression in HDF5 format

You can see: https://github.com/scotmartin1234/HDF5Mathematica The package has the functionality you need for writing at low level. HOWEVER, the high level functions are designed more for reading. ...
ScotMartin's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible