If you insert a WMF that includes a 4-bit image into a Writer document, and export it as PDF while OpenGL is being used, the image looks very wrong in the resulting PDF. The colours are inverted (at least in the sample case I am looking at) and additionally there is some randomise looking noise in the background. Unfortunately the sample WMF can not be made publicly available without asking the customer for permission. Will do.
Ideally I would love to see all internal use of anything except 1bpp (black&white) and 24bpp (full colour) images ("Bitmaps") in LibreOffice go away. There is really no need for palettized colour modes to survive in this century, I think. Such images should be turned into the corresponding 24bpp ones whenever read in, and all code inside LO to handle such formats back and forth could then be dropped. But that is just my opinion; of course it is possible that doing that would have a significant negative impact on performance or resource use in some pathological but not uncommon cases, or whatever.
Looking closer at the WMF, it first has one 1bpp image that is StretchBlt:ed with SRCPAINT, then a 4bpp one that is StretchBlted to the same place with SRCAND. I would assume that it is the 4bpp one that is mishandled, though.
Tomaž Vajngerl committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=c2fc93cae194a1aad94721edc51078b168a34f5f tdf#100451 convert texture buffer to 1-bit and 4-bit palette buffer It will be available in 5.3.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Tomaž Vajngerl committed a patch related to this issue. It has been pushed to "libreoffice-5-2": http://cgit.freedesktop.org/libreoffice/core/commit/?id=60b74fe1775e647545d2da1fcc58a4c63ec18aa5&h=libreoffice-5-2 tdf#100451 convert texture buffer to 1-bit and 4-bit palette buffer It will be available in 5.2.0.1. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Tomaž Vajngerl committed a patch related to this issue. It has been pushed to "libreoffice-5-1": http://cgit.freedesktop.org/libreoffice/core/commit/?id=ebad0ff6da52d3f3bf9ca026ed2699df0673ce76&h=libreoffice-5-1 tdf#100451 convert texture buffer to 1-bit and 4-bit palette buffer It will be available in 5.1.5. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.