Re: [Inkscape-devel] [cairo] PS/PDF Gradients
On Mon, 29 Jan 2007 00:27:27 +1030, Adrian Johnson wrote:
I have been testing Miklós' PDF gradient patch from http://lists.freedesktop.org/archives/cairo/2006-August/007648.html
Thanks for keeping this alive, Adrian!
I know that the inkscape developers, (among others), are very anxious to see cairo generate PDF files with native gradients rather than falling back to rasterization---since other than this issue, cairo is providing very good PDF export capability.
Looking at the patch the only obvious deficiency I could see is lack of support for the different cairo_extend_t options. The patch has the PDF /Extend value set to [true true] which is equivalent CAIRO_EXTEND_PAD.
Testing linear gradients with rgb stops appears to be ok. Changing the PDF /Extend value set to [false false] which is equivalent CAIRO_EXTEND_NONE also works.
OK, well one thing we definitely need is a test case for linear gradients with all of the extend modes, (could be much like the recent radial case I added).
The results of testing linear gradients with CAIRO_EXTEND_PAD and rgba stops are: acroread - ok but the colors seem to be too dark. evince - broken, The padded region is opaque when it should have some transparency. ghostscript - broken. all opaque colors. no transparency.
All I looked at was the output from poppler which the test suite uses. I'm also seeing the colors as too dark, but otherwise the results look quite promising, (again without testing extend modes yet). Here's the reference image (sorry it's so tiny):
http://cairographics.org/~cworth/images/linear-gradient-ref.png
and here's the rendering of the PDF output:
http://cairographics.org/~cworth/images/linear-gradient-pdf-argb32-out.png
So that just looks like one simple color scaling issue somewhere.
And once we test the extend modes, it would at least be very easy to only turn on native gradients for known-good extend modes.
I have not tested radial gradients.
I did now, and it's not too pretty. Here's our reference image:
http://cairographics.org/~cworth/images/radial-gradient-ref.png
and here's the rendering of the PDF output:
http://cairographics.org/~cworth/images/radial-gradient-pdf-argb32-out.png
So it looks like there's still a fair amount of work to be done there.
Anyway, if anyone wants to help out with this, it would be *greatly* appreciated.
I took this quick look to see if there was anything here in a state ready to make it into 1.4, but it looks like there's not.
-Carl
On Fri, 02 Mar 2007 04:48:53 -0800, Carl Worth <cworth@...573...> wrote:
I know that the inkscape developers, (among others), are very anxious to see cairo generate PDF files with native gradients rather than falling back to rasterization---since other than this issue, cairo is providing very good PDF export capability.
The biggest issue is still that Cairo rasterizes groups (which, when object opacity is used, means pretty much anything). Will you have time to look at that with me this weekend? I tried to attack it during the week, but I got completely lost.
-mental
On Fri, 2 Mar 2007 11:36:42 -0800, MenTaLguY wrote:
The biggest issue is still that Cairo rasterizes groups (which, when object opacity is used, means pretty much anything).
Oh, right. I'd forgotten about that one.
Will you have time to look at that with me this weekend? I tried to attack it during the week, but I got completely lost.
I'm making 1.4 as we speak, (just typing release notes), and I'll be doing pretty much nothing of cairo this weekend. But yes, let's work together on this soon.
I definitely want to make sure we have a 1.4.2 release as soon as possible, and these are the goals I have for that:
* Fill all XFAIL test cases
* Give inkscape everything it needs for a switch to cairo
- fix a8-mask XFAIL (patch exists on list---and got good - review from inkscape folks)
- fix long-lines XFAIL (switch from 16.16 to 24.8 for internal fixed-point storage)
- fix rasterization of PDF gradients (starting from Miklós patch on the list)
- fix rasterization of PDF groups (make pdf create_similar return a meta-surface in a way similar to what the SVG backend does
* Turn on X server gradients
* Other cool stuff that people really wanted in 1.4 but just didn't quite make it.
-Carl
participants (2)
-
Carl Worth
-
MenTaLguY