How do I simplify EPS vector drawings?
January 25, 2005 2:36 PM   Subscribe

Simplifying eps vector drawings. I'm looking for a way to eliminate overlapping paths in complex line drawings. Almost all of the lines are made up of multiple independent, straight paths sitting precisely on top of each other. To shrink the file size and make editing easier I'd like to get rid of this redundancy. Is converting to raster then back to vector the best solution?

I'm using Adobe Creative Suite, btw.
posted by shoos to Computers & Internet (14 answers total)
Just thinking out loud, but doesn't Illustrator have the capability to remove these overlaps while the file is still vector?
posted by AlexReynolds at 2:40 PM on January 25, 2005

Response by poster: Alex, that's what I had hoped, but couldn't find that function.

matt, no, the images were generated from a piece of software for biological research. They're just histograms made up of straight lines which are supposed to be straight. It's just that each line is made up of a bunch of overlapping paths. I just want one path per line.
posted by shoos at 3:27 PM on January 25, 2005

It's hard to judge without seeing the artwork, but as I understand it, for each line of the histogram, the line is actually multiple copies of itself, not segments butted end to end. As long as none of the histogram bars intersect other bars, you can select all and then use the "outline" filter under pathfinder. This will also remove all the styling from the lines (stroke weight and color) but should result in one line per bar.

If the bars intersect, then the outline filter would produce a new endpoint at each intersection, so this wouldn't work for more complex artwork (though it would still remove all the overlap) because it would result in artwork that's almost impossible to edit.

Another approach I would try is to directly select the top-most line in each bar and lock it. (You'll need to directly click the line instead of drag-selecting). Once you've essentially locked the entire top layer, then select all and delete. This gets rid of all the lower copies.

And converting to raster, then back to vector is almost never the best solution, unless you're working with very organic forms.
posted by Jeff Howard at 3:49 PM on January 25, 2005

There's a section here on joining paths in AI. This might help with overlapping paths.
posted by AlexReynolds at 3:51 PM on January 25, 2005

Freehand can do this, and while I haven't used Illustrator CS too much I am sure it can too - try the various tools in the "pathfinder" palette.

Don't try to flatten it in photoshop and then autotrace again in Indesign (I assume that's what you mean by going vector > raster > vector). You'll lose resolution; remember, your vector files are resolution-independent and you'll lose a lot of resolution by rasterizing, even in a perfect world where your art is pure black and white and all 90 degree angles.
posted by luriete at 4:39 PM on January 25, 2005

Response by poster: Matt, I sent you one of the files.

Alex, joining paths would work, but I don't think I can do that en masse. Just one line by one, and that would take me hours to finish just a couple of the images.

Jeff, each line is actually made up of a mix of full-length and partial-length paths, some of which overlap and some of which don't. If you could look at a typical line from the "side," the layers would look like this (the dots represent empty space):


I have no idea why the software makes it like this.
posted by shoos at 4:43 PM on January 25, 2005

Okay, I just tried it with lines as you describe. Here's my suggestion.

1) Select All

2) Choose "Outline" within the pathfinder.

3) Restyle the lines as appropriate (stroke weight, color)

4) Choose "Object > Path > Outline Stroke" (might be different in CS) from the menu

5) Choose "Expand" (might be called "Add to Shape Area") in the Pathfinder. Then expand that appearance.

6) Each line will end up as one object--a very long thin rectangle that looks and prints just like a line. (It has a fill, but no stroke)
posted by Jeff Howard at 5:17 PM on January 25, 2005

Response by poster: Thanks a lot for all your help.

Jeff, the file Matt modified and sent me seems to have turned out essentially the way your method makes it. It does simplify the drawing, but the file size stays about the same or gets a little bit bigger rather than smaller. When we put a bunch of these histograms on a single page in Illustrator like we normally do, the program gets really bogged down due to the complexity of the drawings. It would be nice to make the files more efficient.

If any other ideas come up, let me know!
posted by shoos at 5:51 PM on January 25, 2005

eeeh! I think I've got it Starting after Jeff's #6:

7) Select all the rectangles you just created

8) 'Transform Each'. Scale the objects to 0% (yes, 0%) so the rectangles are back to having only one dimension. If you started with horizontal lines, scale vertically and vice versa.

9) Draw a large, rectangle behind the histogram. Make sure all the lines fit w/in this rectangle

10) Select your histogram lines and the large rectangle you just drew. Go to the 'Pathfinder' palette and do a divide.

11) Ungroup everything and delete the large rectangle

This *should* leave you with all your lines intact and back to being true lines, composed of two endpoints and nothing more. Just stroke them back up to desired weight, and you should be good to go.
posted by nathan_teske at 5:54 PM on January 25, 2005

Response by poster: Nathan, that sounds like it's almost it, but not quite. The drawing contains horizontal, diagonal and vertical lines that touch each other. So, when I do the expand, the all the lines merge into one object, and when I do the 'scale each,' the object just gets smashed into one line. If there were some way to just select the vertical lines, your method would probably work.
posted by shoos at 6:51 PM on January 25, 2005

nathan, that works on my end (for vertical lines). Very cool tip.

shoos, the file size shouldn't change much based on line vs shape. Are we talking Ks or MBs? A noticable performance difference would surprise me too. You might consider saving each histogram as a seperate EPS, then assembling them in a page layout program like InDesign or Quark.

Also, FYI has a vibrant Illustrator forum (and most of their other products) that might be of more help in these type of situations.
posted by Jeff Howard at 7:06 PM on January 25, 2005

Response by poster: Jeff, no, the files didn't change much in size (eg, 650 kb to 700). My thought is that if I could change the drawing so that all lines are represented by just a single path instead of 5 or 6, the load on my system would be minimized. How much in file size this means, I'm not sure. I'll try putting the histograms separately into InDesign. Thanks.
posted by shoos at 9:40 PM on January 25, 2005

Damn foiled by art I haven't seen ;)

... When you did your add, did you have 'remove redundant points' selected in the pathfinder options? Sneaky little bugger, likes to deselect itself and not save in the prefs. Try selecting the histogram and doing a simplify and restrict it to using straight lines. that should clean out any extra points.

and as an aside, if you're running Illustrator CS on Mac OS X, I found that upgrading to 10.3.7 resulted in a significant speed increase on my Powerbook.
posted by nathan_teske at 10:28 PM on January 25, 2005

Response by poster: Nathan, I tried doing it with 'remove redundant points' selected, but I got the same result. The whole thing gets smashed into one vertical line. Thanks for the suggestions, though!

If you're really curious, I could send you one of the histograms.
posted by shoos at 12:44 PM on January 26, 2005

« Older UK Spring Trip   |   Special Cell Phone Newer »
This thread is closed to new comments.