Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > Tuning & Debugging > Memory Measurement & Optimization > Compress >
Mathematica > Systems Interfaces & Deployment > Mathematica Sessions > Mathematica Session Information > Memory Measurement & Optimization > Compress >

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
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF