Bug 169346 - PNG with transparent background inverted in print output when Skia is disabled
Summary: PNG with transparent background inverted in print output when Skia is disabled
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
25.2.6.2 release
Hardware: ARM macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Graphics-Export
  Show dependency treegraph
 
Reported: 2025-11-08 21:03 UTC by Florian
Modified: 2025-11-28 12:40 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example document with embedded PNG file (44.54 KB, application/vnd.oasis.opendocument.text)
2025-11-08 21:04 UTC, Florian
Details
PNG file with transparent backgound and black context (32.35 KB, image/png)
2025-11-08 21:05 UTC, Florian
Details
macOS print preview (PNG is inverted) (804.40 KB, image/png)
2025-11-08 21:05 UTC, Florian
Details
LibreOffice print preview (PNG is NOT inverted) (480.42 KB, image/png)
2025-11-08 21:06 UTC, Florian
Details
Test document exported to PDF (39.01 KB, application/pdf)
2025-11-16 11:16 UTC, Florian
Details
Test document printed to PDF (61.71 KB, application/pdf)
2025-11-16 11:17 UTC, Florian
Details
Screenshot of LO 25.8.3.2 (AARCH64) showing the issue (371.72 KB, image/png)
2025-11-18 07:20 UTC, Florian
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Florian 2025-11-08 21:03:04 UTC
Description:
When I add a PNG image with transparent background (alpha channel) and black content into a LibreOffice document (e. g. Calc, Impress, Writer) and print that document, then the PNG image is printed with inverted colors.

Surprisingly the print preview (icon with document and magnifier) shows everything correct.

Steps to Reproduce:
1. Create a PNG with transparent background and black elements in it
2. Add the PNG to a new Writer document
3. Print the document

Actual Results:
The PNG is printed with inverted colors.

Expected Results:
The PNG is printed as shown in the LibreOffice's print preview and edit view.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Maybe related to #126876?
Comment 1 Florian 2025-11-08 21:04:08 UTC
Created attachment 203825 [details]
Example document with embedded PNG file

This is the document I use to reproduce the issue
Comment 2 Florian 2025-11-08 21:05:03 UTC
Created attachment 203826 [details]
PNG file with transparent backgound and black context
Comment 3 Florian 2025-11-08 21:05:49 UTC
Created attachment 203827 [details]
macOS print preview (PNG is inverted)
Comment 4 Florian 2025-11-08 21:06:21 UTC
Created attachment 203828 [details]
LibreOffice print preview (PNG is NOT inverted)
Comment 5 Eyal Rozenberg 2025-11-15 19:30:54 UTC
Have you looked at Bug 98275: "PNG image with alpha channel pasted from clipboard has black background"? May be related.
Comment 6 Eyal Rozenberg 2025-11-15 19:42:52 UTC
I could not reproduce using your reproduction instructions. I tried both with your attached document (attachment 203825 [details]) and with a PNG image I created on my own using GIMP 3 and inserted into an empty Writer document.

Tried with:

Version: 25.2.5.2 (X86_64) / LibreOffice Community
Build ID: 03d19516eb2e1dd5d4ccd751a0d6f35f35e08022
CPU threads: 4; OS: Linux 6.12; UI render: default; VCL: gtk3
Locale: en-IL (en_IL); UI: en-US
Calc: threaded

and:

Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: d2def868cb3ac5a7e538a911e83d7d907a2ec794
CPU threads: 4; OS: Linux 6.12; UI render: default; VCL: gtk3
Locale: en-IL (en_IL); UI: en-US
Calc: CL threaded

do you see this only when printing to a physical printer, or also when printing to file (e.g. PDF file)? If you also see this when printing to PDF files, can you please attach such a printed PDF? Also, what about Exporting rather printing to PDFs?
Comment 7 Florian 2025-11-16 11:15:20 UTC
This also happens when I print to PDF.

It does *not* happen when I export to PDF.
Comment 8 Florian 2025-11-16 11:16:41 UTC
Created attachment 204020 [details]
Test document exported to PDF
Comment 9 Florian 2025-11-16 11:17:02 UTC
Created attachment 204021 [details]
Test document printed to PDF
Comment 10 Florian 2025-11-16 11:26:53 UTC
This is not related to bug #98275. The issue described there does not happen to me (no black background after copy/paste).

I was wondering if this has something to do with MacOS printing system, so I created a document in Apple Pages and added the PNG. No black background there in the printing output.

I also opened Wikipedia's demo file for PNG with transparency (https://en.wikipedia.org/wiki/File:PNG_transparency_demonstration_1.png) in my browser (Chrome) and printed it out and everything is fine.

So this seems to be related to LibreOffice's print rendering.
Comment 11 Robert Großkopf 2025-11-17 08:11:49 UTC
Tested with 
Version: 25.8.3.2 (X86_64)
Build ID: 8ca8d55c161d602844f5428fa4b58097424e324e
CPU threads: 6; OS: Linux 6.4; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Calc: threaded

Couldn't reproduce with printing to PDF and the attached document.

Might be a special MAC-bug?
Comment 12 Patrick (volunteer) 2025-11-17 22:43:33 UTC
I cannot reproduce this in either of the following macOS versions:

Version: 25.2.7.2 (AARCH64) / LibreOffice Community
Build ID: 5cbfd1ab6520636bb5f7b99185aa69bd7456825d
CPU threads: 8; OS: macOS 26.1; UI render: Skia/Metal; VCL: osx
Locale: en-CA (en_CA.UTF-8); UI: en-US
Calc: threaded

Version: 25.8.3.2 (AARCH64)
Build ID: 8ca8d55c161d602844f5428fa4b58097424e324e
CPU threads: 8; OS: macOS 26.1; UI render: Skia/Metal; VCL: osx
Locale: en-CA (en_CA.UTF-8); UI: en-US
Calc: threaded

@Florian The "affected version" field for this bug is set to 25.2.6.2 but since I cannot reproduce it in 25.2.7.2, it might have already been fixed. Do you still see this bug in 25.2.7.2 or later versions?
Comment 13 Florian 2025-11-18 07:18:58 UTC
@Patrick yes, I still can reproduce the issue using LibreOffice 25.8.3.2 (AARCH64)
Comment 14 Florian 2025-11-18 07:20:14 UTC
Created attachment 204056 [details]
Screenshot of LO 25.8.3.2 (AARCH64) showing the issue
Comment 15 Florian 2025-11-18 07:34:39 UTC
Note: I had Skia disabled due to crashes I experienced when enabled. When Skia is enabled, the issue does not appear.
Comment 16 Alex Thurgood 2025-11-28 12:38:18 UTC
Confirming with

Version: 25.8.1.1 (AARCH64)
Build ID: 54047653041915e595ad4e45cccea684809c77b5
CPU threads: 8; OS: macOS 26.1; UI render: Skia/Metal; VCL: osx
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Calc: threaded

Deactivated Skia rendering in LO Preferences
Tested with OP's uploaded Writer document.
Printed to Brother Laser MFC-L8690CDW
Document prints out a black square with white text instead of the original black text on transparent background.