AlphaComposite translations to SVG #56
Replies: 2 comments
-
When I looked at this previously I wasn't able to find a solution so, as you observe, JFreeSVG is mostly using SRC_OVER. This is one area where JFreeSVG is not doing well on the Graphics2D tester I created: https://github.com/jfree/graphics2d-tester I'll take another look and see if can figure something out that would work. |
Beta Was this translation helpful? Give feedback.
-
Yes, it seems not that obvious that some alpha composite operators are "raster" oriented math functions. I do not know if it is even possible to create a 1-1 translation for SVG vectors in current SVG specification. But is is interesting to see what is possible and what is not, if there is a chance of a "simulation" via alpha values, filers or combination of those. I could not find many info about it other than the Batik' s approach implemented years ago. An open field for research I guess. |
Beta Was this translation helpful? Give feedback.
-
Hi..
I would like to ask if alpha composite operators other than SRC_OVER can be translated to SVG as simple alpha values.
Batik's SVGGenerator as far as I can see, only supports SRC_OVER and some AlphaComposite operators are being translated to filters but with strange, unpredictable and mostly useless results, so what you see in Java is not what you get as SVG.
It seems jfree produces the same result with SRC_OVER and XOR (tested 5.0.5).
Are all AlphaComposite operators being replaced with SRC_OVER with jfreesvg?
Is it possible to emulate/approximate somehow operators like XOR or this is impossible considering the Graphics2D raster to SVG vector idiosyncrasies? thanks
Beta Was this translation helpful? Give feedback.
All reactions