Bug 92592 - Background image is much too dark
Summary: Background image is much too dark
Status: NEW
Alias: None
Product: poppler
Classification: Unclassified
Component: cairo backend (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-22 10:38 UTC by Thomas Freitag
Modified: 2015-10-28 22:22 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
PDF with background image that is rendered too dark (221.19 KB, application/pdf)
2015-10-22 10:38 UTC, Thomas Freitag
Details
Multiply opacity in case of pattern colorspace (5.47 KB, patch)
2015-10-22 11:10 UTC, Thomas Freitag
Details | Splinter Review
attachment-9391-0.html (7.39 KB, text/html)
2015-10-28 22:22 UTC, Thomas Freitag
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Freitag 2015-10-22 10:38:16 UTC
Created attachment 119063 [details]
PDF with background image that is rendered too dark

The background image in the attached PDF is rendered much too dark with poppler.

The PDF uses a transparency group with fill and stroke opacity of 0.35:

gs /GS1
  gfx state dict: << /CA 0.35 /OP false /OPM 0 /Type /ExtGState /ca 0.35 /op false >>

Inside this transparency group a pattern colorspace is used:

cs /Pattern
scn /P0

The background image is part of the pattern colorspace, more exactly the pattern colorspace is this image, and before the image is painted the fill opacity is reset to 1:

gs /ca0
  gfx state dict: << /Type /ExtGState /ca 1 >>
Do /img0

So inside the pattern the fill opacity is 1, but the pattern itself should be set with fill opacity of 1.

In this PDF splash is not able to use its own tilingPatternFill, so it falls back to Gfx::drawForm. But because Gfx::drawForm draws directly in splash bitmap, the fill opacity of the image is used which overwrites the fill opacity of the pattern.
Comment 1 Thomas Freitag 2015-10-22 10:44:35 UTC
How it should be rendered is shown with acrobat reader or simply call

gs kühl.pdf

which renders it also correctly. The PDF is rendered also wrong with cairo, therefore I set it to the general component.
I was able to fix it for the splash backend, in the moment just for doTilingPatternFill, even if it happens probably also in doShadingPatternFill, but since I'm not sure and have no samples for it, I create a patch just for doTilingPatternFill and splash.
I will upload the patch when it successfully pass the regtest.
Comment 2 Thomas Freitag 2015-10-22 11:10:48 UTC
Created attachment 119065 [details] [review]
Multiply opacity in case of pattern colorspace

This patch solves it for splash and tiling pattern fills.
The patch passed my regression test successfully.
Comment 3 Albert Astals Cid 2015-10-28 22:06:44 UTC
Pushed, moving to cairo
Comment 4 Thomas Freitag 2015-10-28 22:22:14 UTC
Created attachment 119265 [details]
attachment-9391-0.html

Guten Tag,
vielen Dank für Ihre Nachricht!
Ich bin bis einschließlich 01.11.2015 nicht im Büro.
Ihre Emails werden in dieser Zeit weder gelesen noch weitergeleitet.
In dringenden Fällen wenden Sie sich bitte an unsere Hotline
Telefon +49 (0) 6074 3104 333
E-Mail support@alfa.de
Nach meiner Rückkehr werde ich Ihre Nachricht umgehend beantworten.
Hello,
Thank you for your message!
Unfortunately, I am out of the office to November 1 2015 inclusive.
During this time, your e-mails will not be read or forwarded.
For urgent matters, please contact our hotline:
phone +49 (0) 6074 3104 333
e-mail support@alfa.de
I will respond to your e-mail immediately on my return.
Mit freundlichen Grüßen / kind regards
Thomas Freitag
Software-Entwicklung
alfa Media Partner GmbH
Niederlassung Kiel
Sophienblatt 57
24114 Kiel
Germany
Phone:  +49 (0) 431  /66119-38
Fax:      +49 (0) 431 / 66119-11
Visit our homepage www.alfamedia.com<http://www.alfa.de/>
Sitz des Unternehmens: Rödermark - AG Offenbach HRB 21171
Geschäftsführer: Jens Emmerich
Diese Nachricht kann vertrauliche Informationen enthalten und ist nur für die namentlich bezeichneten Empfänger bestimmt.
Falls Sie nicht namentlich als Empfänger dieser Mitteilung angeführt sind, sollten Sie diese Mitteilung nicht weiterverbreiten, kopieren oder weiterleiten.
Bitte informieren Sie uns umgehend per E-Mail, falls Sie diese Mitteilung fälschlicherweise erhalten haben und löschen Sie dieses E-Mail endgültig aus Ihrem System.

This message may contain confidential information and is intended only for the individual named.
If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
Please notify the sender immediately by e-mail if you have received this e-mail-message by mistake and delete this e-mail-message from your system.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct.