Skip to content

Fixed PdfDocument.RenderToPng#61

Merged
gfoidl merged 1 commit intomainfrom
pdf2png_fix
Dec 25, 2025
Merged

Fixed PdfDocument.RenderToPng#61
gfoidl merged 1 commit intomainfrom
pdf2png_fix

Conversation

@gfoidl
Copy link
Copy Markdown
Owner

@gfoidl gfoidl commented Dec 25, 2025

According to https://gitlab.freedesktop.org/cairo/cairo/-/commit/f74b11415a1f7682dd50c222baa8815ef93681dc:

In order to support blend modes, we need to use a clear background whilst rendering the PDF, which inspired the use of DEST_OVER to avoid having to render to an intermediate surface. However, the adjunct of using subpixel text means that we cannot simply using the alpha channel as the sole mask and so need to render to an intermediate and paint it over an opaque background.

According to https://gitlab.freedesktop.org/cairo/cairo/-/commit/f74b11415a1f7682dd50c222baa8815ef93681dc:
In order to support blend modes, we need to use a clear background whilst rendering the PDF, which inspired the use of DEST_OVER to avoid having to render to an intermediate surface. However, the adjunct of using subpixel text means that we cannot simply using the alpha channel as the sole mask and so need to render to an intermediate and paint it over an opaque background.
@gfoidl gfoidl added the area-cairo-extensions Extensions for cairo label Dec 25, 2025
@gfoidl gfoidl merged commit d811a3d into main Dec 25, 2025
2 checks passed
@gfoidl gfoidl deleted the pdf2png_fix branch December 25, 2025 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-cairo-extensions Extensions for cairo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant