Strange Color Issue with 32bpp PNG and PDF Output

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Post Reply
User avatar
Sheri Steeves
Posts: 146
Joined: Tue Aug 05, 2008 5:06 pm
Location: Ottawa, Ontario,CANADA
Contact:

Strange Color Issue with 32bpp PNG and PDF Output

Unread post by Sheri Steeves »

Hello,

I have stumbled onto a strange issue with H&M and the PDF files created.

The software we create is file/image conversion software so the PDF files I create as part of the software documentation often get used in-house for testing. It was during this testing that strange colour issues was noticed with the PDF files generated from H&M (7.2.0 Build 4035).

We first noticed it when printing the PDF file as an image through Adobe Reader to our products, image printers that create images from whatever you print to them; with certain print options the colours in the PDF file were wrong (like they had been switched from RGB order to BGR order).

Then we noticed that converting the same PDF file to an image using Ghostscript (from another product we create) gave us a PDF file with incorrect link colours (red instead of blue) and other incorrectly coloured text.

At first we thought it was an issue with our software and spent a few days debugging and testing accordingly. In the end, the culprit turned out to be a 32bpp PNG file for a small icon image I was using in the documentation. I have been using the image for about two years now and we do not see this behaviour with the same PDF files created with previous versions of H&M.

Finally, at the end of last week we noticed that trying to load the created PDF into Ghostview (set to use Ghostscript 9.21) would give the following errors; we were particularity interested in the ProcessColorModel error.

Code: Select all

GSview 4.9 2007-11-18
GPL Ghostscript 9.21 (2017-03-16)
Copyright (C) 2017 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Scanning PDF file
%GSVIEW_PDF_PAGES: 1 1
Displaying PDF page 1
%GSVIEW_PDF_PAGE: 1
%GSVIEW_PDF_MEDIA: [0 0 612.0 792.0]
%GSVIEW_PDF_ROTATE: 0
%GSVIEW_PDF_MARK: /LNK /View [/XYZ 40.0 545.0 0] /Page 1 /File 4 /Border [0.0 0.0 0.0] /Rect [99.0 583.0 283.000031 595.0] /F 4
Error: /undefined in --get--
Operand stack:
   --dict:7/16(L)--   --dict:27/27(ro)(L)--   --dict:27/27(ro)(L)--   ProcessColorModel
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   false   1   %stopped_push   1983   1   3   %oparray_pop   1982   1   3   %oparray_pop   1966   1   3   %oparray_pop   1852   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--
Dictionary stack:
   --dict:1212/1684(ro)(G)--   --dict:1/20(G)--   --dict:87/200(L)--   --dict:137/256(ro)(G)--   --dict:297/300(ro)(G)--   --dict:32/32(L)--   --dict:6/9(L)--   --dict:22/40(L)--
Current allocation mode is local
Last OS error: No such file or directory
pdf_page failed
Once we saw this, I tried to create a smaller sample PDF file to send you to test with and that is when we narrowed it down to the 32bpp PNG causing a problem. I have reproduced this with several different 32bpp PNG files created from various sources and the same Ghostview\Ghostscript error happens with each.

For now I think I can get around this by changing my images to 24bpp PNG files. Is this a known issue?

Thanks,

Sheri
User avatar
Tim Green
Site Admin
Posts: 23153
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Strange Color Issue with 32bpp PNG and PDF Output

Unread post by Tim Green »

Hi Sheri,

This is something that we need to look into, and we would need a couple of examples for testing. Please mail a small sample project with sample images and your .mnl PDF template to support AT ec-software.com (replace the AT with @) and we will look into it. To make things easier, please include the text of your posting here in the accompanying mail. :)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Alexander Halser
EC-Software Support
Posts: 4098
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Re: Strange Color Issue with 32bpp PNG and PDF Output

Unread post by Alexander Halser »

Hi Sheri,

Please send us the PNG image with a small test project that triggers the problem.

However, it is very likely that this PNG file is indeed the problem and it makes sense that you did not notice that with earlier versions of H&M. In H&M 7 we changed the handling of PNG images in PDF and embed the native PNG image, to preserve alpha-transparency. Versions prior HM7 did simply paint the PNG against its current background and embed a bitmap or JPEG compressed bitmap from the image, but not the original PNG data. So the PDF results are indeed a bit different when comparing HM6 and HM7.

You could open this PNG file with a PNG capable image editor re-save it, then export the PDF again. Does that make a difference?
Alexander Halser
Senior Software Architect, EC Software GmbH
User avatar
Sheri Steeves
Posts: 146
Joined: Tue Aug 05, 2008 5:06 pm
Location: Ottawa, Ontario,CANADA
Contact:

Re: Strange Color Issue with 32bpp PNG and PDF Output

Unread post by Sheri Steeves »

Alex and Tim,

Thanks for the response. I will get you a sample project to your support e-mail today.

Alex, in my testing I found the same results with the original PNG 32bpp PNG file as well as other 32bpp PNG files I have recently created. The first image was created by exporting from icon creation software we used to use, the others were created from exporting as picture from smart art diagrams from Powerpoint.

I worked around this issue for now by using GIF images in my documentation.


Thanks,

Sheri
Post Reply