This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Compress

Compress[expr]
gives a compressed representation of expr as a string.
  • Compress[expr] gives a compressed representation of any expression.
  • The string generated by Compress contains only printable ASCII characters.
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:
A compressed representation of with 100-digit precision:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
 
Import an image:
In[1]:=
Click for copyable input
Out[1]=
Number of bytes used to store the image:
In[2]:=
Click for copyable input
Out[2]=
Number of bytes of a compressed representation of the image:
In[3]:=
Click for copyable input
Out[3]=
 
Compress a general expression:
In[1]:=
Click for copyable input
In this case there is almost a factor of 50 compression:
In[2]:=
Click for copyable input
Out[2]=
New in 6