Created attachment 77658 [details]
result of convert svg to pdf
After conveting svg file to pdf using rsvg-convert, when i was opened pdf in Adobe Illustrator there are vector objects with transparenct. There are link of a bug http://i.piccy.info/i7/653f328a0dbeaf90674aee5b78857045/4-57-939/53122784/illustrator.png
The PDF file was created using 1.12.2. Please test with 1.2.14 as there have been a few bugs fixed since 1.12.2.
I will also need the SVG file.
Created attachment 77669 [details]
I was added svg file. 1.12.14 its version of rsvg-convert? how can i run new version on windows?
I used rsvg-convert to convert the svg to pdf. The pdf is displayed correctly by Adobe Reader, Evince, and Ghostscript.
But try open pdf file in adobe illustrator and you will see what about i speak
in the first comment i was provide link to screenshot of pdf file in ilustrator
I don't have Illustrator. Since the PDF renders correctly in acroread, evince, and ghostscript the bug must be in Illustrator.
Could you send me please your converted pdf file?
Created attachment 77672 [details]
But your pdf file has same bug in illustrator. Could this be a problem with cairo?
TRy open file in Inkscape. There are same problem as in illustrator. I think the bug in conversion from svg to pdf
else illustrator rasterize output pdf
This bug is present at 1.14.2 - I just detected it affecting GIMP's PDF export in all versions -
And the original complaint, with example images at:
I hope the fact it is reproducible using GIMP's PDF export makes it easier to track and fix, as there is no need of another minimal program to reproduce it.
(GIMP's plug-in use a call to cairo_paint_with_alpha, but I found out it also happens when calling simply cairo_paint)
I ran cairo-trace on rsvg-convert while convert the svg in comment 2 to pdf. It appears rsvg-convert is supplying the mask as a bitmap. I'm not sure why as cairo is capable of rendering the svg with all vector operations which would result in an all vector pdf. This would be the cause of the mask problem.
I need more info for the gimp issue in comment 13. eg a test case and sample pdf output.
Created attachment 118973 [details]
(In reply to Massimo from comment #15)
> Created attachment 118973 [details]
> test case
The GIMP issue, as I understood it, is probably a poppler bug
where a raster surface is resampled using unpremultiplied
components and so suffering of color bleeding.
the black color attributed to completely transparent pixels
is used interpolating partly transparent pixels and appears
at the border of white shapes drawn above a white background.
The attached program saves a pdf that when opened in GIMP
is completely white if you set a resolution of 72 dpi, but
shows the grey arc shape when a different resolution is chosen.
Similarly behaves pdftocairo: the output of
pdftocairo -png -rx 72 -ry 72 bug-63302.pdf bug-63302.72-dpi
is completely white, whereas the output of
pdftocairo -png bug-63302.pdf bug-63302.150-dpi
shows the grey arc outline.
Created attachment 118974 [details]
test case fixed to turn off interpolation
The cairo pdf backend embeds images exactly as they are. There is no resampling done. The interpolation is being done by the pdf viewer. You can see the embedded images using pdfimages.
Attached is an updated version of the test case that causes the interpolate flag in the embedded image to be set to false. The problem is pdf viewers may ignore this flag. This can be seen in evince where at higher zoom levels the image is not interpolated and the gray pixels disappear. At lower magnification evince will turn on interpolation to match Adobe Reader behavior.
There really isn't anything that can be done in cairo. The cairo pdf backend is creating a pdf that reproduces the cairo drawing operations supplied to it. It is up to the viewer how it is rendered.
Possible (untested) workarounds:
- Use a higher resolution image
- Ensure the color image is larger than the mask.
Created attachment 118999 [details] [review]
poppler quick hack
This is a poppler quick hack that fixes the gimp issue
The idea is to combine the image and the soft mask in
image space (so with no resampling needed if they have
the same dimensions) and then paint the result on the
destination in destination space.
I don't have the poppler test suite so I don't know how
much it breaks, but firefox renders the output of my previous
test case completely white and so I think poppler could
do a better job as well.
PS: in the function modified by the quick hack if one of the
first two 'goto cleanup;' is executed 'maskPattern' is leaked.
-- GitLab Migration Automatic Message --
This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/cairo/cairo/issues/89.