Transparent backgrounds and eps exports

Post questions on how to use or achieve an effect in Inkscape.
BitJam
Posts: 2
Joined: Thu Sep 23, 2010 3:38 am

Transparent backgrounds and eps exports

Postby BitJam » Thu Sep 23, 2010 4:22 am

I'm an Inkscape newbie and I'm lovin' it. I'm working on drawings that will end up in pdf documents by being included in LaTeX documents. I prefer to export to eps because this speeds up the pdf rendering compared to when I export to pdf (and \includegraphics{$NAME.pdf}).

I was struggling with transparent backgrounds for a while. Most drawings I created had transparent backgrounds by default, which is sweet. But some drawings had a white background and I struggled and struggled to get rid of it with no success. I think I finally figured out what was going on. If I have a simple circle, normally the area around the circle (the area between the circle and the bounding rectangle) will be transparent in an exported eps. BUT, if I fill the circle with a linear gradient and part of the gradient is transparent then the area around the circle will become all white and the transparent part of the fill will be white as well. Sometimes this white background can infect the entire drawing (in addition to the area between the circle and the bounding rectangle) but I'm not sure when this happens and when it doesn't. As I implied above, I can sometimes side-step this problem by exporting to pdf instead of eps.

I don't think this is a bug as much it is a miscommunication. While Inkscape can deal with a full-fledged alpha-channel, it appears that the alpha in exported eps files is all or nothing, so when a transparent gradient is asked for against the background, the exported eps file defaults to no real transparency and assumes white is the background color being blended in. Transparent gradients against the solid background of an object underneath the one with the gradient are no problem.

So if someone is having trouble exporting transparent backgrounds to eps, they might want to make sure there are no gradients (against the background) that have non-zero alpha in them. Maybe, someday, if there is no easier way, the devs might want to add a checkbox to the eps export dialog that will automatically remove alpha gradients against the background.

In the meantime, I'm still struggling a bit to figure out how to remove the alpha from a gradient against the background from clipart I've downloaded such as the earth graphic by barretr on http://www.openclipart.org (which is not quite working right ATM). It's kind of ironic that it is the inclusion of alpha (in a gradient) that causes the eps to lose transparency.

Anyway, thanks for the great tool. I hope the information above will be helpful to someone.

BitJam
Posts: 2
Joined: Thu Sep 23, 2010 3:38 am

Re: Transparent backgrounds and eps exports

Postby BitJam » Fri Sep 24, 2010 5:22 am

I see this problem has already been addressed here and here.

The reason exported pdfs with gradients take so long to render is because the gradient is automatically turned into a bunch of tiny strips. I believe the solution suggested in the bug report I link to above, adding an "export gradients as clipped bitmaps" is what I want. For now, I can export as pdf which deals with gradients "correctly" (no white boxes) but takes longer to render due to all the little strips. Or I can manually remove all gradients and export to either eps or pdf. This renders faster but looks flat.


Return to “Help with using Inkscape”