       Re: to reduce notebook size

• To: mathgroup at smc.vnet.net
• Subject: [mg121015] Re: to reduce notebook size
• From: "Vivek J. Joshi" <vivekjjoshi29 at gmail.com>
• Date: Mon, 22 Aug 2011 06:04:10 -0400 (EDT)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• References: <201108160525.BAA17857@smc.vnet.net>

```The way I reduce notebook size with a lot of graphics is to convert the
graphics to Bitmap. You can do the following experiment,

p1=Plot3D[Sin[x y],{x,0,2 \[Pi]},{y,0,2 \[Pi]},PlotPoints->100]

-Graphics-

The notebook size at this point is 2.8mb.

Click on the output cell on the right of the Graphics and goto,

Cell >> Convert To >> Bitmap

The notebook size at this point is 102kb.

If you have a lot of graphics you can press Alt + Output Cell, this will
select all output cells in the notebook and now you can convert all
graphics to Bitmap in one step.

Hope this helps,

Vivek

On Aug 16, 2011, at 1:25 AM, McHale, Paul wrote:

> I've been trying to reduce the storage requirement of graphics (plots,
tables...).  This is very useful in reducing notebook size.  It also
makes it much easier to email or paste into Word.  I'm having a hard
time meeting all three objectives (Notebook, Outlook and Word).
Rasterize[] works OK until plot points are low.
>
> p1=Plot3D[Sin[x y],{x,0,2 \[Pi]},{y,0,2 \[Pi]},PlotPoints->100];
> ByteCount[p1]
> Show[p1]
>>> 3,222,360
>
> c1=Rasterize[p1,RasterSize->1000];
> ByteCount[c1]
> Show[c1]
>>> 9,613,064
>
> In this case, the original graphic is preferred.  But when I increase
the plot information:
>
> p1=Plot3D[Sin[x y],{x,0,2 \[Pi]},{y,0,2 \[Pi]},PlotPoints->300];
> ByteCount[p1]
> Show[p1]
>>> 11,620,992
>
> c1=Rasterize[p1,RasterSize->1000];
> ByteCount[c1]
> Show[c1]
>>> 9,613,064
>
> I have tried saving a Notebook with the following options:
>
> p1=Plot3D[Sin[x y],{x,0,2 \[Pi]},{y,0,2 \[Pi]},PlotPoints->100]
> Size is 2,741KB
>
> p1=Plot3D[Sin[x y],{x,0,2 \[Pi]},{y,0,2 \[Pi]},PlotPoints->100];
> Rasterize[p1,RasterSize->1000]
> Size is 512KB
>
> p1=Plot3D[Sin[x y],{x,0,2 \[Pi]},{y,0,2 \[Pi]},PlotPoints->100];
> s=ExportString[p1,"JPEG2000"];
> s=ImportString[s,"JPEG2000"];
> Show[s]
> Size is 222KB
>
> p1=Plot3D[Sin[x y],{x,0,2 \[Pi]},{y,0,2 \[Pi]},PlotPoints->100];
> s=ExportString[p1,"PNG"];
> s=ImportString[s,"PNG"];
> Show[s]
> Size is 111KB
>
> Of course, higher plot points is very different:
> p1=Plot3D[Sin[x y],{x,0,2 \[Pi]},{y,0,2 \[Pi]},PlotPoints->300]
> (*     s=ExportString[p1,"PNG"];
> s=ImportString[s,"PNG"];
> Show[s] *)
> Size is 9,938KB
>
> p1=Plot3D[Sin[x y],{x,0,2 \[Pi]},{y,0,2 \[Pi]},PlotPoints->300];
> s=ExportString[p1,"PNG"];
> s=ImportString[s,"PNG"];
> Show[s]
> Size is 108KB
>
> I'm not saying any of this is a surprise.  Just empirically
determining how to best optimize the storage and transmission
requirements with little impact on quality.  The email size is harder to
quantify.
>
> Anyone with guidelines or input I would appreciate it.   Using
graphics directly looks the best in all cases.  The size  becomes
incredibly large when there are a large number of points.  Compression
seems to produce results which vary with image content.  Some look good,
some look terrible.  Maybe there are settings to PNG that could improve.
>
> Thanks,
> Paul
>
>
> Paul McHale  |  Electrical Engineer, Energetics Systems  |  Excelitas
Technologies Corp.
>
> Phone:   +1 937.865.3004   |   Fax:  +1 937.865.5170   |   Mobile:
+1 937.371.2828
> 1100 Vanguard Blvd, Miamisburg, Ohio 45342-0312 USA
> Paul.McHale at Excelitas.com<mailto:Paul.McHale at perkinelmer.com>
> www.excelitas.com<http://www.excelitas.com>
>
>
> Please consider the environment before printing this e-mail.
> This email message and any attachments are confidential and
proprietary to Excelitas Technologies Corp. If you are not the intended
recipient of this message, please inform the sender by replying to this
email or sending a message to the sender and destroy the message and any
attachments.
> Thank you
>

```

• Prev by Date: problem with Graphics array --plots don't appear
• Next by Date: Re: Getting 3d printable models out of 3d graphics in Mathematica
• Previous by thread: Compression of Plot[] to reduce notebook size
• Next by thread: Re: Compression of Plot[] to reduce notebook size