Transparency issues in pdf output

Post questions on how to use or achieve an effect in Inkscape.
dalegribble
Posts: 2
Joined: Fri Dec 04, 2015 7:12 pm

Transparency issues in pdf output

Postby dalegribble » Fri Dec 04, 2015 8:25 pm

Hi everybody,

Sorry for the bother, but I'm having some transparency issues with my pdf output in Inkscape that I have been unable to resolve. I would really appreciate any advice on the matter.

To the point, I'm creating a histogram for use in a scientific article, The histogram is an overlay of two sets of data, showing how similar they are. In my example, I used Julia to generate two sets of data, and used Gadfly to draw the overlay to an SVG file. This was achieved by layering the two histograms with some transparency. I opened the SVG files in Inkscape and added text descriptions and then saved them as pdfs for use in my tex file. However, the pdfs do not display the transparency and just put one layer on top of the other with no interaction between the two. Oddly enough, the thumbnail preview panel in Evince does show the picture properly, which led me to think that it was simply a deficiency of Evince. I tried viewing the pdf in Okular, but there both the thumbnail preview and the pdf itself do not show the transparency. I'm somewhat confused as to where the problem actually is. Moreover, the SVG output from Gadfly is such that I do not see how to manipulate the file to produce the desired effect based on other threads about transparency issues.

I dropboxed the SVG in question at https://www.dropbox.com/s/uaizgudpqww7hyz/transparency_test.svg?dl=0
as well as the PDF output (https://www.dropbox.com/s/llpl8wjhhwanpmx/transparency_test.pdf?dl=0). The thumbnail in Evince looks like Image, which is what I'm shooting for (except not for ants).

Thanks for the read!

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Transparency issues in pdf output

Postby brynn » Mon Dec 07, 2015 11:13 am

I probably can't help much. But your operating system and Inkscape version will help those who can.

In general, there shouldn't be a problem for transparency in Inkscape to be displayed properly in a PDF. But having imported these images from the other programs, results in an XML file that I'm not familiar with. For example, the color and opacity are applied to the group rather than each individual rectangle, while each individual rectangle has Unset fill/stroke. It might be that Unset fill/stroke that's the problem, although that's a BIG guess (and probably wrong :o ).

While I know Inkscape fairly well, I'm not a very tech-savvy Inkscape user. But I would try ungrouping....it looks like there would be several rounds of ungroup, until you get down to each graph/color. For example, I went

-- click on top purplish object
-- Ungroup
-- deselect

Repeat 2 or 3 times, making sure to deselect after each ungroup, and reselect the top graph. Be sure to watch the status bar closely, to see what you have selected, before and after each ungroup. That will guide you to where you need to be.

Eventually I got down to a Group of 150. At that point, I would copy the color hexcode, and note the Opacity setting. Then Ungroup, and reapply the color to that multiple selection of 150, and opacity also. (If you accidentally deselect that, you'll have to undo back until you have the Group of 150 again.) Then after applying the color and opacity to that multiple selection, immediately group them again.

I don't know if that will work. But that's what I would try. (Don't ungroup any of the text -- makes it huge, for some reason!) I saw some clipped groups as I went along. But I never actually found a clipping path. Sometimes ungrouping also unclips, but that didn't seem to happen for me, in this file, luckily.

PS -- At least in that top purple graph, there is a very narrow black stroke (0.16 px). I don't know if you want to keep that. There is a known bug (in some versions) where very narrow strokes aren't displayed in PDF, so they might not be displayed anyway. I'm not sure if that could be contributing to your larger problem with transparency or not. But if I didn't have any reason for that stroke, I would just remove it. If it is needed, I would make it wider, so it will show up.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Transparency issues in pdf output

Postby Moini » Mon Dec 07, 2015 12:07 pm

It's even simpler:

- Select everything, ungroup once.
- Select the middle part. Do Object -> Clip -> Release (the middle part is clipped, see status line). Delete the black rectangle.
- Save to pdf.
- Looks right now (the original somehow only looks right in previews...)

So this problem was associated with the clip only :)
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Transparency issues in pdf output

Postby brynn » Mon Dec 07, 2015 4:55 pm

Moini wrote:So this problem was associated with the clip only :)


Wow! But still, I thought clips in Inkscape would still be ok exported to PDF. I think I've even tried it before, but don't remember for sure.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Transparency issues in pdf output

Postby ~suv » Mon Dec 07, 2015 9:57 pm

AFAICT you encountered a known issue in certain versions of the graphics library which Inkscape uses for PDF export (cairo), tracked for Inkscape in
[ The issue is fixed in latest stable cairo release (1.14.4), see also attached PDF file which was exported with Inkscape 0.91 and cairo 1.14.4 without any edits to the SVG file ]
Attachments
dalegribble-transparency_test-091-cairo-1_14_4.pdf
(16.01 KiB) Downloaded 307 times

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: Transparency issues in pdf output

Postby Moini » Tue Dec 08, 2015 3:07 am

I've got 1.13 - in this case, seems that was an advantage, so I could test ;) - thanks, suv!
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

dalegribble
Posts: 2
Joined: Fri Dec 04, 2015 7:12 pm

Re: Transparency issues in pdf output

Postby dalegribble » Tue Dec 08, 2015 9:19 am

Thanks for all the help, everyone! Everything looks right now, which is a huge relief. Thanks again!


Return to “Help with using Inkscape”