# Reducing the size of exported .eps files to the minimum necessary

Running version 10.3 on my Power Mac with 22 Gbytes of memory I can create and export an .eps or .pdf graphics such as,

headandchest = Show[
Entity["AnatomicalStructure", "Neck"]["Graphics3D"]];


which I later use in a document. However, the file size is rather large (~30 MByte). If instead I merely click on the graphic output in my Mathematica session and Save As..., then the file size is rather small (~300 kByte), yet appears in full resolution in the final document. This is the version I need. Presumably there is a great deal of three-dimensional data in the original 3D graphics that is not copied when I copy directly from the Mathematica cell, rather than Export it.

(If your computer has less memory than mine, I suspect you can observe the same problem with a large, yet somewhat smaller, image file than mine.)

How can I Export the proper small file-size .eps or .pdf version of such a graphic? (Rasterize and other methods to convert the image to a pixel-based formal are not acceptable.)

My problem has nothing whatsoever to do with the speed at which the files are written (as answered elsewhere), but instead with the size of the exported file.

• Possible duplicate of Speeding up EPS exporting ? – Edmund Nov 30 '15 at 19:43
• @Edmund I don't think this is a duplicate of the question you linked to: the solution proposed there was to generate a rasterized version of the desired image, and David has already excluded any method involving rasterization as unacceptable to him in this case. – MarcoB Nov 30 '15 at 20:23
• @David: I have also tried to use your code without success. It took quite a bit of time to even render the headandchest graphic, and the Export just hung my machine until I had to force quite Mathematica. I use v10.3 on Win7-64 with 8GB of RAM. How long did it take to generate the EPS file with Export, and how much memory do you have? – MarcoB Nov 30 '15 at 20:26
• Not a duplicate. See the original question, extended. – David G. Stork Nov 30 '15 at 21:22
• I think it a fair question why save as and Export produce such different results. Can you try to find a somewhat smaller example that shows the issue? – george2079 Nov 30 '15 at 22:25

What you actually need is to flatten your vector image. AFAIK there is no way to perform this operation in Mathematica. In this answer I discuss known ways to do this using third-party software. Probably the most fast and simple solution would be to Export your image in vectors into PDF format using Jen's workaround and then use Adobe Acrobat Pro for converting it into flattened vector EPS file as I describe in the linked answer.
I cannot check this solution myself because an attempt to Export your example figure into PDF kills my system with 8 Gb of physical memory.