Marco Steinacher wrote:
Dear Inkscape Developers, ... To facilitate this task I have automated this workaround (removing transparency by adding shapes covering the overlapping areas with the corresponding mixed color). So far I am quite happy with that solution, although it obviously does not work for gradients etc., and I would like to include it in the official Inkscape version.
Very cool :) But why does it "obviously" not work for gradients? As long as the transparency doesn't vary over the gradient it shouldn't be too difficult, and if it does you could try adding stops to keep the appearance more or less the same.
In this regard I have a few questions to you:
- Are there any general objections to add this code to Inkscape?
I doubt it (without having looked at the code of course).
- Where would you place this function in the UI? (For my personal use I
have added the item "Remove Transparency" to the Path menu, which probably is not appropriate.)
Perhaps just do it automatically at export? (Possibly adding some hard to find checkbox to disable it, or make it depend on the background colour, if anyone feels the need.) I mean, why would anyone NOT want to do this? As far as I'm concerned it's just a way to make the EPS export as correct as possible. Or am I missing something?
Explicitly exposing it to the user seems like a bit of a cludge, it would just make the document more complex and harder to manage, while keeping the appearance the same.
Related to this question is the question how to deal with the limited ability of this approach in order to not confuse or annoy users (e.g. when they use it with gradients).
I'm not a big fan of popping up message boxes stating that "features XYZ are not supported in this format", but perhaps something like that will suffice if there aren't too many unsupported features.
- Where would you ideally add the code for this feature? Currently I
have added four functions sp_remove_transparency*() to splivarot.cpp. I chose this file because of the relation to sp_selected_path_intersect(). Also, I have copied some code from sp_selected_path_boolop() to get the intersection shapes and I suggest to put the common code in a more generic boolean operation function in order to avoid duplicate code.
Sounds sensible, but I have hardly any experience with this part of the code, so I can't really comment on the appropriateness of the location.