1

Sorry if this has been answered before and I know it's probably something really simple, but illustrator is driving me crazy!

I have a simple filled triangle shape which I'm trying to create a slice from via the Object > Slice > Make menu option in Illustrator CC 2014. However whenever I do it (with the triangle selected) it leaves gaps between the object edge and the slice edge. I really want the slice to be as tight to the object as possible (i.e. no white space), so I don't end up with gaps when using the image on a website.

See this image for an example:

Illustrator Gaps

If anyone can help me with this I would be extremely grateful.

Thanks

  • Is the artwork aligned to the pixel grid? – Scott Jun 5 '15 at 17:04
  • Thanks @Scott - selecting align to pixel grid solved the problem. – grahamt Jun 6 '15 at 14:10
0

If you are trying to make pixel perfect artwork, you should select objects and ensure Align To Pixel Grid is checked on the Transform Panel. This is the entire reason that feature was added to Illustrator. You may need to nudge shapes after checking this. Just hit the left arrow on the keyboard then the right arrow.

You'll also want to ensure Pixel Preview is active.

My guess is that your slice is hitting a pixel and your shape is not at an exact pixel position... so you see a gap.

| improve this answer | |
  • Thank you, that was indeed the problem! All other shapes in the document were set to align to pixel grid, but not that one for some reason. Deleting the slice, selected align to pixel grid and then remaking the slice solved the problem. Thanks again for your help. – grahamt Jun 7 '15 at 9:26
1

First, double check that you don't have any points or shapes you might've missed: Switch your view to Outline mode.

If all's well with the vectors, you also need to check your pixel output. Switch on Pixel preview to see how Illustrator is trying to rasterize this vector object prior to export. And keep in mind, that Illy sometimes has issues with rasterization and determining their exact boundaries.

enter image description here

Here's a few side-by-sides of how much things can change (thank you Interwebs).

cute chef

bad rectangle

aligning art to pixel grid

| improve this answer | |
  • I should also take this opportunity to remind people that Sketch does a much better job of handling exports. – plainclothes Jun 5 '15 at 18:17
  • Thanks for your answer. Turned out 'align to pixel grid' was the problem in the end, but your suggestions helped narrow down the problem significantly :) – grahamt Jun 7 '15 at 9:28
0

There are a couple of scenarios I know of which could produce this effect.

1) This can happen if your triangle is inside a mask. The slice function will hug the boundaries of the mask and ignore the mask's contents. So if your mask is larger than the shape it is masking, your slices will produce gaps between what you can see and the invisible mask. If this is the case, use the trim function to simultaneously trim the contents to the mask boundary and delete the mask.

2) If you have the objects grouped with a guide, the slice will hug the guide. Make your guides visible and unlock them. Select your triangle and see if the guide is selected as part of a group. If it is, just ungroup or delete the guide.

| improve this answer | |

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.