dali icon indicating copy to clipboard operation
dali copied to clipboard

mix-blend-mode ignored in rasterization?

Open IsaacWallis opened this issue 7 years ago • 1 comments

Sorry if this is a bit of a dumb question, I'm newish, but, if I use this dali code:

(def blend                                                                                                                                  
    [:dali/page                                                                                                                                            
        [:defs                                                                                                                                                 
            (s/css                                                                                                                                                
                (str "rect {stroke: black; mix-blend-mode: difference;}\n"))]                                                                                        
        [:rect {:fill :pink} [80 60] [250 250]]                                                                                                                
        [:rect {:fill :blue} [140 120] [250 250] 80]                                                                                                           
        [:rect {:fill :turquoise} [180 180] [250 250]]])

then do (d/render-svg blend "diff1.svg") browsers and OSes show me an image like this: image

which is correct (I think).

Then if I do (d/render-png blend "diff1.png") I get this: image

It seems like the blend mode is being ignored in rasterization? Perhaps this is another batik bug?

IsaacWallis avatar Jan 07 '19 01:01 IsaacWallis

Unfortunately, this is most likely because of a problem with batik, the java library dali uses internaly for rasterizing into PNGs. I say unfortunately, because it means that it's out of my control to fix. I've had other problems with batik, so you may want to use inkscape from the command line instead to produce PNGs: http://tavmjong.free.fr/INKSCAPE/MANUAL/html/CommandLine-Export.html

stathissideris avatar Jan 09 '19 11:01 stathissideris