PS/PDF API Change Proposal: (Re: [cairo] Semantics of
transparent objects)
Owen Taylor
otaylor at redhat.com
Thu Jan 19 16:28:52 PST 2006
OK, I was just talking to Carl some about this on IRC, and two points
that came up were:
- No matter what model we choose, it's always possible to emulate the
other by creating a group, drawing to it, then compositing the
result.
- If you have code that needs one or the other, it likely is going
to be used as part of creating a more complex document; the
code being called at some point has no control of how the
document was created.
Telling people to create a group is a more flexible way of going
about things.
To me that implies we should just pick a model for how print surfaces
work and stick to it, instead of having two different models that
you have to chose between at document creation time.
While my initial reaction was very much that CAIRO_CONTENT_COLOR was
the right model for printing, I've come around a bit and tend to think
that CAIRO_CONTENT_COLOR_ALPHA would be a better choice; some of the
things we discussed or that occur to me:
- CAIRO_CONTENT_COLOR_ALPHA is a little more intuitively obvious
when considering printing on tinted paper.
Though it should be noted that (for normal printers) the result
of printing on tintend paper won't actually match what you'd get
if you drew with an alpha channel and composited that onto the
paper.
So, this is more of a question of conforming to people's instincts
than a color-science thing.
- Somewhat related to the above is the intuitive idea that CLEAR (and
CLEAR-like operators like DEST_OUT) should give you the media
color in cleared areas.
- The Cairo operator set is more flexible when drawing with destination
alpha. A lot of the Cairo operators simply do nothing useful
when drawing without destination alpha.
- It matches the formal model of PDF
But I think the caveat there is that we shouldn't specify too exactly
how the CONTENT_COLOR_ALPHA model is transformed into the resulting
file. That is, the composite-against-white that is done currently is
just an implementation detail to deal with the fact that postscript
doesn't have good support for destination alpha.
With PDF we might want to generate alpha images instead, or at least
should reserve that option.
Regards,
Owen
More information about the cairo
mailing list