Description: When exporting an Excel document to PDF using the command-line option `--convert-to pdf`, images that have a duotone filter applied lose their transparency. In the resulting PDF, the affected images appear fully opaque instead of preserving their original transparency. Steps to Reproduce: 1. Prepare an Excel file that contains an image with a duotone filter applied. 2. Export it using: `soffice --headless --convert-to pdf filename.xlsx` 3. Open the generated PDF. Actual Results: The transparency of the duotone-filtered image is lost, and the image is rendered as fully opaque in the PDF output. Expected Results: Transparency should be preserved when exporting duotone-filtered images to PDF. Reproducible: Always User Profile Reset: No Additional Info: The issue appears to originate from the duotone conversion logic in `BitmapDuoToneFilter::execute()`. The alpha channel is not propagated to the output color, causing the resulting bitmap to lose transparency. A minimal fix is shown below: diff --git a/vcl/source/bitmap/BitmapDuoToneFilter.cxx b/vcl/source/bitmap/BitmapDuoToneFilter.cxx index 2dd10459e242..d0bb35cf6863 100644 --- a/vcl/source/bitmap/BitmapDuoToneFilter.cxx +++ b/vcl/source/bitmap/BitmapDuoToneFilter.cxx @@ -41,10 +41,12 @@ Bitmap BitmapDuoToneFilter::execute(Bitmap const& rBitmap) const BitmapColor aColor = pReadAcc->GetColor(y, x); sal_uInt8 nLuminance = aColor.GetLuminance(); BitmapColor aResultColor( + ColorAlphaTag::ColorAlpha, lcl_getDuotoneColorComponent(nLuminance, aColorOne.GetRed(), aColorTwo.GetRed()), lcl_getDuotoneColorComponent(nLuminance, aColorOne.GetGreen(), aColorTwo.GetGreen()), - lcl_getDuotoneColorComponent(nLuminance, aColorOne.GetBlue(), aColorTwo.GetBlue())); + lcl_getDuotoneColorComponent(nLuminance, aColorOne.GetBlue(), aColorTwo.GetBlue()), + aColor.GetAlpha()); pWriteAcc->SetPixel(y, x, aResultColor); } }
Created attachment 204572 [details] Sample Excel file to reproduce the issue This file demonstrates the issue where applying a duotone filter causes the alpha channel to be lost in the resulting image.
Created attachment 204579 [details] Test LBO 25.8.3.2 vs 26.2.0.0-b1 Test image not consistent between LBO 25.8.3.2 vs 26.2.0.0-b1
I'm struggling to reproduce this. To set the duotone, I set the image to greyscale, then I change the color value of the red channel to something like 10%. I then export the pdf per the instructions, but it does show fine. I'm doing this on macOS, but I can't see how that would make much of a difference.
Thanks for checking. This issue was discovered when the output result changed after updating the LibreOffice version, using the attached file. I suspect this is a side effect of the integration of `BitmapEx` into `Bitmap`. Please note that the duotone setting in the attached Excel file was most likely created in Microsoft Excel. I have not verified whether the same duotone configuration can be reproduced within LibreOffice itself, so it may differ from the settings you described. It may be useful to test specifically with the attached file, as the behavior seems to depend on how the duotone was originally defined.
Confirm Version: 26.8.0.0.alpha0+ (X86_64) Build ID: 7f660cc7544889a3171e29a6d5c9100ed7f41448 CPU threads: 4; OS: Linux 6.8; UI render: default; VCL: gtk3 Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US Calc: threaded
This seems to have begun at the below commit in bibisect repository/OS linux-64-26.2. Adding Cc: to Noel Grandin ; Could you possibly take a look at this one? Thanks 8ebd2b4e46ef510c93c9f69cec47f86484e71740 is the first bad commit commit 8ebd2b4e46ef510c93c9f69cec47f86484e71740 Author: Jenkins Build User <tdf@maggie.tdf> Date: Tue Dec 2 20:46:34 2025 +0100 source df4873973ed6951ab63c59129226d18055f771fc 190303: simplify Graphic::applyDuotone | https://gerrit.libreoffice.org/c/core/+/190303
Noel Grandin committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/0c1df806d965609b46a0c7cec08752c0234b2538 tdf#169934 Transparency is lost when applying a duotone filter It will be available in 26.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Noel Grandin committed a patch related to this issue. It has been pushed to "libreoffice-26-2": https://git.libreoffice.org/core/commit/32d2478a3d11ae4bd2030d0fafe4e882c91cb264 tdf#169934 Transparency is lost when applying a duotone filter It will be available in 26.2.1. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Xisco Fauli committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/5ccf49826eb51efa763bcfba1a256386cb1c5a7d tdf#169934: vcl_bitmap_test: Add test It will be available in 26.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Noel Grandin committed a patch related to this issue. It has been pushed to "libreoffice-26-2-0": https://git.libreoffice.org/core/commit/ed03d719a299a9dd5abbc0ec3d90873502afac7b tdf#169934 Transparency is lost when applying a duotone filter It will be available in 26.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.