1
$\begingroup$

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"]];
Export["[my file path]\headandchest.eps", headandchest, "EPS"]

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.

$\endgroup$
  • 1
    $\begingroup$ Possible duplicate of Speeding up EPS exporting ? $\endgroup$ – Edmund Nov 30 '15 at 19:43
  • $\begingroup$ @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. $\endgroup$ – MarcoB Nov 30 '15 at 20:23
  • $\begingroup$ @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? $\endgroup$ – MarcoB Nov 30 '15 at 20:26
  • $\begingroup$ Not a duplicate. See the original question, extended. $\endgroup$ – David G. Stork Nov 30 '15 at 21:22
  • 1
    $\begingroup$ 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? $\endgroup$ – george2079 Nov 30 '15 at 22:25
2
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ Thanks. We should suggest to Wolfram Research that they include the flatten option in exporting. In the meantime I guess I'll simply copy and paste the large images, as described. $\endgroup$ – David G. Stork Dec 2 '15 at 16:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.