3
$\begingroup$

I would like to import some annotated diagrams from Microsoft Visio. When using PNG, the imported images look good at 100% but quickly become blurred at any other magnification.

What is the cleanest image format and best practice to follow when importing images into Mathematica without loss when the notebook or slide deck is magnified higher than 100%?

$\endgroup$
1
  • 1
    $\begingroup$ Anything based on vector graphics, I suppose. Rasterized formats won't rescale nicely. $\endgroup$
    – Michael E2
    Apr 30, 2017 at 12:29

1 Answer 1

6
$\begingroup$

To avoid blur, you need to use a vector graphics format.

Mathematica can import DXF, EPS and PDF.

Out of these, DXF is for engineering. It is not suitable for general graphics.

Mathematica only has limited support for PDF and EPS. It will not be able to handle complex files. Try PDF first. If the Imported graphics do not look good (or accurate), try reprocessing the PDF through some program (like Ghostscript or Preview.app on Mac) and save it using an earlier specification (e.g. PDF 1.3).

If Mathematica still cannot import the file, try to make it simpler. Avoid gradients, blur, shadows, etc. when preparing the file.

$\endgroup$
3
  • 1
    $\begingroup$ PDF definitely provides a clean and scalable image. Some additional notes for using Visio 2013 as a source for the PDF: (1) Use the Size | Fit to Drawing on the Design Ribbon Bar prior to saving to a PDF. (2) Use Mathematica Drawing Tools to add equations to your image. $\endgroup$ Apr 30, 2017 at 13:40
  • 2
    $\begingroup$ @DougKimzey Note that PDF supports both vector and rasterized graphics, so how the PDF is created is important. (E.g. some effects might be implemented by rasters, like those Szabolcs refers to.) $\endgroup$
    – Michael E2
    Apr 30, 2017 at 15:43
  • $\begingroup$ ".. so how the PDF is created is important" - this is a very good point. One thing I noticed was that importing an image saved as a PDF from Visio may give odd results such as thick lines. This seems to be an issue with PDFs in general. One workaround (which may be reasonable) is to take the image from Visio to PowerPoint. Then save the PowerPoint to a PDF. Import this PDF into Mathematica. This gives a cleaner image in Mathematica (and Word) than a PDF saved from Visio. A bit of an odd workaround that will probably not be required in future versions. $\endgroup$ May 1, 2017 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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