Open GitBruno opened 1 year ago
I've noticed a while ago that Cairo actually generate a raster image when using blend modes. it doesn't calculate using vectors so maybe this is why it is not saving. It is unfortunate, I love blend modes on vectors too
hmm what are you looking at the PDF and SVG with? could you share your output files?
here is what i got (macOS12.6):
below the produced files. blendMode_test.pdf
it however seems cairo ignores ofBackground() -- it needs an explicite rect to blend to white as the GL renderer does. moreover, it needs a call to ofEnableBlendMode to "activate" (perhaps there is a funny default cairo blendmode).
ofEnableBlendMode(OF_BLENDMODE_ALPHA);
ofSetColor(ofColor(255,255,255));
ofDrawRectangle(0,0,ofGetWidth()/2,ofGetHeight()/2);
I am running Running Windows 11 Pro 22H2 and viewing the PDF (attached) with Acrobat Pro. I downloaded your file and that one looks perfect! Could it be a Mac/Windows difference? blendMode_test.pdf
i confirm your blendMode_test.pdf is not transparent in macOS12. inspecting the PDF source shows similar files (both generated by cairo 1.14.12) but reveals a difference at line 18:
my version:
/ExtGState <<
/b2 << /BM /Normal >>
/b14 << /BM /Multiply >>
/a0 << /CA 1 /ca 1 >>
>>
your version:
/ExtGState <<
/a0 << /CA 1 /ca 1 >>
>>
i can also confirm generating on linux produces transparency. unfortunately i cannot test windows.
is there anybody else on windows that can try the squares code at the top? so we can confirm if it's a generalized platform issue or something specific to a configuration.
@GitBruno perhaps post on the forum for a windows test request? (including a directly compilable .h and .cpp so it's painless). you can link to this issue in case some want the background info.
more people over there -- might get a quicker response than here (and maybe more variety also if it turns out to be specific to some parameter)
The blend modes look good on screen but is not saved to PDF or SVG.