Compress

Compress[expr]

gives a compressed representation of expr as a string.

Details and Options

  • Compress[expr] gives a compressed representation of any expression.
  • The string generated by Compress contains only printable ASCII characters.
  • Uncompress is the inverse of Compress.

Examples

open allclose all

Basic Examples  (3)

A compressed representation of with 100-digit precision:

Import an image:

Number of bytes used to store the image:

Number of bytes of a compressed representation of the image:

Compress a general expression:

In this case there is almost a factor of 50 compression:

Properties & Relations  (1)

Compress a list of unique numbers and plot the sizes:

Compress a list with repeated values and plot the sizes:

Wolfram Research (2007), Compress, Wolfram Language function, https://reference.wolfram.com/language/ref/Compress.html.

Text

Wolfram Research (2007), Compress, Wolfram Language function, https://reference.wolfram.com/language/ref/Compress.html.

CMS

Wolfram Language. 2007. "Compress." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Compress.html.

APA

Wolfram Language. (2007). Compress. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Compress.html

BibTeX

@misc{reference.wolfram_2024_compress, author="Wolfram Research", title="{Compress}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/Compress.html}", note=[Accessed: 18-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_compress, organization={Wolfram Research}, title={Compress}, year={2007}, url={https://reference.wolfram.com/language/ref/Compress.html}, note=[Accessed: 18-November-2024 ]}