Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #9290 > unrolled thread
| Started by | "Michael A. Morrison" <morrison@nhn.ou.edu> |
|---|---|
| First post | 2012-03-29 09:10 +0000 |
| Last post | 2012-03-31 08:42 +0000 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
reduce size of eps files of 3D figures "Michael A. Morrison" <morrison@nhn.ou.edu> - 2012-03-29 09:10 +0000
Re: reduce size of eps files of 3D figures JUN <noeckel@gmail.com> - 2012-03-30 09:35 +0000
Re: reduce size of eps files of 3D figures danl@wolfram.com - 2012-03-31 08:42 +0000
| From | "Michael A. Morrison" <morrison@nhn.ou.edu> |
|---|---|
| Date | 2012-03-29 09:10 +0000 |
| Subject | reduce size of eps files of 3D figures |
| Message-ID | <jl18t9$md1$1@smc.vnet.net> |
For a book I am writing, I am generating a lot of 3D figures using, for example, Graphics3D. Many of the resulting Exported *.eps files are huge, even for a simple case such as a row of three objects such as Graphics3D[Sphere[]]. These figures will not be printed in color. Is there a way to generate *.eps files for such a situation that are smaller than those Exported if one does nothing special? Many thanks in advance. --- michael Michael A. Morrison Dept. Physics & Astronomy University of Oklahoma Norman, OK 73019 Phone: 405 325-3961 FAX: 405 325-7557 EMAIL: morrison@nhn.ou.edu
[toc] | [next] | [standalone]
| From | JUN <noeckel@gmail.com> |
|---|---|
| Date | 2012-03-30 09:35 +0000 |
| Message-ID | <jl3upl$3ii$1@smc.vnet.net> |
| In reply to | #9290 |
On Thursday, March 29, 2012 2:10:01 AM UTC-7, Michael A. Morrison wrote:
> For a book I am writing, I am generating a lot of 3D figures using, for
> example, Graphics3D. Many of the resulting Exported *.eps files are huge,
> even for a simple case such as a row of three objects such as
> Graphics3D[Sphere[]]. These figures will not be printed in color. Is there a
> way to generate *.eps files for such a situation that are smaller than those
> Exported if one does nothing special? Many thanks in advance. --- michael
Hi,
here is a new trick that I recently stumbled upon in Mathematica 8: to make Mathematica export all 3D graphics in your notebook in a very efficient way, just execute the following before creating the plots:
Map[SetOptions[#,
Prolog -> {{EdgeForm[], Texture[{{{0, 0, 0, 0}}}],
Polygon[#, VertexTextureCoordinates -> #] &[{{0, 0}, {1,
0}, {1, 1}}]}}] &, {Graphics3D, ContourPlot3D,
ListContourPlot3D, ListPlot3D, Plot3D, ListSurfacePlot3D,
ListVectorPlot3D, ParametricPlot3D, RegionPlot3D, RevolutionPlot3D,
SphericalPlot3D, VectorPlot3D}];
This creates an invisible triangle (with a transparent texture) and adds it as a Prolog to all 3D plotting functions. The mere presence of this invisible element forces Mathematica to give up trying to export EPS and PDF versions made of individual polygons. That's the reason for the large file size. Instead, it decides to use a high-resolution rasterization of your plot and embeds it into the EPS file. I chose to use the Prolog option for this trick because I'm assuming it's rarely used with 3D graphics.
With this, you need to make no changes to any of your subsequent Export commands - the simple form Export["file.eps", plot] will work fine.
More discussion of this (and an example where the file size is reduced rom 200 MByte to 400KByte) is found here:
http://pages.uoregon.edu/noeckel/MathematicaGraphics.html#PDF3D
Jens
[toc] | [prev] | [next] | [standalone]
| From | danl@wolfram.com |
|---|---|
| Date | 2012-03-31 08:42 +0000 |
| Message-ID | <jl6g2i$cmb$1@smc.vnet.net> |
| In reply to | #9290 |
On Thursday, March 29, 2012 4:10:01 AM UTC-5, Michael A. Morrison wrote: > For a book I am writing, I am generating a lot of 3D figures using, for > example, Graphics3D. Many of the resulting Exported *.eps files are huge, > even for a simple case such as a row of three objects such as > Graphics3D[Sphere[]]. These figures will not be printed in color. Is there a > way to generate *.eps files for such a situation that are smaller than those > Exported if one does nothing special? Many thanks in advance. --- michael > > Michael A. Morrison > Dept. Physics & Astronomy > University of Oklahoma > Norman, OK 73019 > Phone: 405 325-3961 > FAX: 405 325-7557 I often use Rasterize[] on such Graphics and Graphics3D. Brings down the size tremendously. Daniel Lichtblau Wolfram Research
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web