I'm getting some very strange output from Illustrator's Image Trace feature. I want to turn this:

Original image

Into a vector shape. Using the Image trace, I haven't been able to get anything even close. The best I have come up with is using the preset "Technical Drawing" with the color turned on:

enter image description here

Any suggestions? I have thousands of these (different but similar shapes) in several files, in grids.

I'm using Illustrator 2015.3.1.

1 Answer 1


Matlab outputs the images as a "flat" image inside a .eps wrapper.

A workaround is to rasterize the image first and then try and trace it.

Alternatively for web-use you can output as a scaleable vector graphic (.svg)

Once exported, if the .svg is missing any elements you can save and run this script on the file to fix any "missing elements".

Sometimes elements appear missing but that is just Matlab creating a convoluted structure because there are incorrect clipping masks on objects. Also, objects are highly grouped with no particular rhyme or reason.

This is a catch-all script that will remove the masks and return layer structure to more normalized levels.

  • Unfortunately deselecting Snap Curves to Lines produces an even worse result (i.e. a curved object). Also, the pen tool (or any other "by hand" method) is out of the question in this case. I have thousands of these (different shaped rectangles) to deal with.
    – Evan
    Commented Jan 8, 2018 at 17:45
  • @Evan Updated answer with settings. Commented Jan 8, 2018 at 17:55
  • Hmm. Maybe there is something strange going on with my image that I am not seeing. Using those exact settings is still giving me a strange result. Like the one pictured in my question, but curvy.
    – Evan
    Commented Jan 8, 2018 at 17:59
  • @Evan is it just a .jpg? Commented Jan 8, 2018 at 18:04
  • 1
    Why are you tracing an eps? They are editable in Illustrator. Try going to Object-> Expand. Commented Jan 8, 2018 at 18:27

Your Answer

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

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