Illustrator exports size of whole JPEG rather than its clipping mask


I am opening my JPEG putting a shape on top and then creating a clipping mask. This works great and I end up with what I want, however my JPEG is still there in the background and the outlines still remain, meaning when I go to export it is exporting the size of the original JPEG as opposed to the clipping mask. if I hide the JPEG in the layers panel the colour in the clipping mask disappears.

as you can see in the photo the shape has filled but the outline (thick blue line) of the jpeg is there still

8/5/2016 4:14:00 PM

That is all working as expected and is how things should work. Your image will always still be behind the clipping mask, thats how a clipping mask works—it masks the image, rather than destructively cropping it.

The problem is therefor how you are exporting your artwork. However you export your artwork there are basically two options, export everything or export your artboard[s].

Using Export, simply check "Use Artboards":

Export Use Artboard

Using Save for Web, check "Clip to Artboard":

Save for Web Use Artboard

(Note, screenshots etc are from Illustrator CS6, things may look different in newer versions.)

If your artboard is not the same size as the artwork you want to export then select your image or clipping mask or whatever you want to export and go to Object → Artboards → Fit to Selected Art, which will fit the artboard to the selected object. You can then export at the correct size.

8/5/2016 4:10:00 PM