Bug 695904 - Image colors wrong with transparency and non-identity transfer function
Summary: Image colors wrong with transparency and non-identity transfer function
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Color Management (show other bugs)
Version: master
Hardware: PC Windows 7
: P1 normal
Assignee: Ray Johnston
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-06 10:25 UTC by Ray Johnston
Modified: 2015-04-23 20:40 UTC (History)
0 users

See Also:
Customer: 532
Word Size: ---


Attachments
Bug695904.pdf (4.10 KB, application/pdf)
2015-04-09 09:41 UTC, Ray Johnston
Details
TF.ps (1.88 KB, application/postscript)
2015-04-09 09:45 UTC, Ray Johnston
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ray Johnston 2015-04-06 10:25:59 UTC
When a transfer function is used by a device, or an ExtGState, colors in images
can be wrong due to the transfer function being applied more than once.

I will attach a simplified test case for this, but this was originally from
customer 532 with a PDF ATS file WWTW61EC_PDFACT.pdf (a version of the QL ATS
produced using "PDF Factory". In the reduced file, without a transfer function,
the colors on the left and right parts match, but when a transfer function is
used that "lightens" the colors, the right rectangle is much lighter. If a
clist is in place, this only occurs in bands that have transparency.

Depending on the source image, the transfer function may be applied when the
image is processed and then again when the pdf14 compositor uses the image
method to perform the pdf14_put_image when the pdf14 device is popped.
Comment 1 Ray Johnston 2015-04-09 09:41:57 UTC
Created attachment 11578 [details]
Bug695904.pdf

File that has a TR at the start. The colors on the left and right of the small
dark rectangle should be the same. Very evident with banding, eg.:

gswin32c -sDEVICE=pgmraw -o xt.pgm -dMaxBitmap=10 -dBandHeight=128 Bug695904.pdf
Comment 2 Ray Johnston 2015-04-09 09:45:48 UTC
Created attachment 11579 [details]
TF.ps

Transfer function that can be used for testing as well. eg.:

gswin32c -sDEVICE=pgmraw -o x.pgm -dMaxBitmap=0 -dBandHeight=128 TF.ps \ Bug695904.pdf
Comment 3 Ray Johnston 2015-04-10 15:18:10 UTC
Fixed in commit 64188c8e3615de788ad916b7d14e24e98d9c289c and sent to the
customer as a patch to their code.

Note that the fix does *NOT* address the arcane handling of transfer functions
as described in PDF 1.7 Ref Manual section 7.6.4. A new, enhancement bug will
be opened to track that issue, but it is not a customer issue (yet). Since it
has worked this way for so long, I doubt it will be an issue for customers
any time soon.