PNG export transparency bug when exporting to pdf

Hi dear community :wink:

I have added a png as image (for a signature) into a writer document. When exporting to pdf the image becomes inverted (negative). Could you help resolve this ?
I could solve it temporarly by printing as pdf… but… does anyone have the solution for this ? Is it a bug from Libreoffice Writer ?

Thanks in advance

Can you post a similar image, not your signature, that behaves the same way?

If not, can you post a screenshot of the image properties

Hi, which property would you like specifically ? Which one could be the reason of the problem ?

You could share a Writer file which includes the PNG file. We then could export it to PDF and check the (faulty) result.
BTW: How did you generate the PNG file? GIMP? LibreOffice Draw? Other program?

The property that seems out of range or obscure.

Is it really a png and not another file type with a png extension?

Start with colour depth. If it is a signature then grey scale or maybe 8 bit (256 colours) would be more than adequate.

Has it some odd compression?..

[Edit]
The image has a mask to hide the background. Remove the background completely and save it as a png with transparency

OZGjKDl7DJ
this is how it shows in the pdf file after export.

This is a crop of it if you can help and analyze the file, thanks a lot !
Signature part

hope you’ll find the problem :pray:

  1. Open Draw and insert the png into Draw. You will see the coloured mask.

  2. Click Tools > Colour Replacer

  3. Under source colour, tick the first box and then click the second larger box

  4. Click the black background, the source colour box will show the selected colour

  5. Click the Replace button
    ColourReplacerMakesMaskTransparent

  6. With it selected, click File - Export. In the dialogue,

    1. tick the box Selection only
    2. Select PNG
    3. Navigate to a suitable folder and give the png a slightly different name so you can identify it.
    4. Click the save button
  7. The next dialogue you can probably ok so long as Save transparency is ticked

  8. Try exporting a document with the new png to pdf.

When imported to GIMP I changed the embedded color profile (see screenshot) and the exported PDF did not show the faulty result. You only had to import (change the color profile) and then to save the png file and it worked as expected. (German GUI)


Thanks Grantler,
I tried but now it changed to signature in white and rectangle full in black (not squares like the one I posted). Weird. Any idea why ? thanks a lot

there is no black background in the original png

There was no difference between your sample PNG and my altered PNG when I exported from Writer into PDF file. See Screenshot (blue background rectangle).





Try to restart in Safe Mode. Is the problem still existing?

thanks but I don’t understand what you mean. You said it was working well after exporting to pdf with your Gimp-treated version, right ?
I’m lost now :slight_smile: sorry
You mean exporting an odt from libreoffice writer to pdf with my original AND your gimp-altered version, they work perfectly both ? Black signature on white ?
thanks

Yes, they did. So I suggested:

I want to thank you ! I found the problem thanks to your help.
It is weird.
I’m using Slim Pdf Reader and HE IS THE PROBLEM ! Showing me those glitches and black backgrounds, I don’t understand why ! I will replace it directly !
Thanks a lot for your help ! This was precious !
The best :pray: