[ pdftex-Patches-259 ] Expanded png inclusion support
Patches item #259, was opened at 2005-01-11 16:44 You can respond by visiting: http://sarovar.org/tracker/?func=detail&atid=495&aid=259&group_id=106 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Taco Hoekwater (taco) Assigned to: Nobody (None) Summary: Expanded png inclusion support Initial Comment: The attached zip file contains a change file for all pdftex's (to be applied *after* hz.cg) and a completely new writepng.c ---------------------------------------------------------------------- You can respond by visiting: http://sarovar.org/tracker/?func=detail&atid=495&aid=259&group_id=106
Hi, This is a complete, working patch, but the zip only contains the actual pngextra.ch and replacement writepng.c, so some manual editting has to be done to the Makefile. The change file needs to be added as the last item of the "pdftex_web_srcs" collection, the C file can overwrite the current file. This version is for testing purposes. I can provide linux 2.6 binaries, but I don't know how to create win32 executables, sorry. The main part of the patch is the new writepng.c, but there is also some web glue to set defaults. The patch contains improvements for PNG image inclusion, specifically: - alpha channel and transparency (only if %!PDF >=1.4) - 16-bit colour (only if %!PDF >=1.5) - gamma correction - forced reduction to greyscale (for Hans) A few primitives had to be introduced to set some default values. There are a total of four new primitives, that are all integer parameters. I almost certainly made mistakes in the WEB coding (initialization locations etc.), but works well enough for testing. Here are the primitives and their defaults: \pdfoptionpdfimagehicolor = 1 % % can be set to 0 if undesirable. This is perhaps needed because % the reader 5 will reject the pdf document's page completely % otherwise. \pdfimagegamma = 2200 % % if not supplied in the image. This example implies that the image % was originally created with gamma value 2.2 (like magnification) \pdfgamma = 1000 % % Gamma value for the 'pdf device'. It looks like this is the % 'correct' value used by Adobe, but I'm not 100% sure. \pdfoptionimageforcegray = 0 % % If 1, all included PNGs are written to the pdf as greyscale. The problem with these primitives is that I am unsure how and when to convert the internal parameters into their C 'fixedxxxxxx' counterparts. It would be a lot cleaner if the C code would use the internal parameters directly, but I'm not sure if that is even possible. Help needed! Greetings, Taco noreply@sarovar.org wrote:
Patches item #259, was opened at 2005-01-11 16:44
Submitted By: Taco Hoekwater (taco) Summary: Expanded png inclusion support
On 2005-01-11 17:29:39 +0100, Taco Hoekwater wrote:
This is a complete, working patch, but the zip only contains the actual
Thanks! Best regards Martin -- Martin Schröder, ms@artcom-gmbh.de ArtCom GmbH, Lise-Meitner-Str 5, 28359 Bremen, Germany Voice +49 421 20419-44 / Fax +49 421 20419-10 http://www.artcom-gmbh.de
Hi, is anyone doing something with Taco's patch? If not I will merge it to pdftex sources (will be uploaded soon as 1.20c-beta<date> Thanh On Tue, Jan 11, 2005 at 05:29:39PM +0100, Taco Hoekwater wrote:
Hi,
This is a complete, working patch, but the zip only contains the actual pngextra.ch and replacement writepng.c, so some manual editting has to be done to the Makefile. The change file needs to be added as the last item of the "pdftex_web_srcs" collection, the C file can overwrite the current file.
This version is for testing purposes. I can provide linux 2.6 binaries, but I don't know how to create win32 executables, sorry.
The main part of the patch is the new writepng.c, but there is also some web glue to set defaults. The patch contains improvements for PNG image inclusion, specifically:
- alpha channel and transparency (only if %!PDF >=1.4) - 16-bit colour (only if %!PDF >=1.5) - gamma correction - forced reduction to greyscale (for Hans)
A few primitives had to be introduced to set some default values. There are a total of four new primitives, that are all integer parameters. I almost certainly made mistakes in the WEB coding (initialization locations etc.), but works well enough for testing.
Here are the primitives and their defaults:
\pdfoptionpdfimagehicolor = 1 % % can be set to 0 if undesirable. This is perhaps needed because % the reader 5 will reject the pdf document's page completely % otherwise.
\pdfimagegamma = 2200 % % if not supplied in the image. This example implies that the image % was originally created with gamma value 2.2 (like magnification)
\pdfgamma = 1000 % % Gamma value for the 'pdf device'. It looks like this is the % 'correct' value used by Adobe, but I'm not 100% sure.
\pdfoptionimageforcegray = 0 % % If 1, all included PNGs are written to the pdf as greyscale.
The problem with these primitives is that I am unsure how and when to convert the internal parameters into their C 'fixedxxxxxx' counterparts. It would be a lot cleaner if the C code would use the internal parameters directly, but I'm not sure if that is even possible. Help needed!
Greetings, Taco
noreply@sarovar.org wrote:
Patches item #259, was opened at 2005-01-11 16:44
Submitted By: Taco Hoekwater (taco) Summary: Expanded png inclusion support
ntg-pdftex mailing list ntg-pdftex@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-pdftex
participants (4)
-
Martin Schröder
-
noreply@sarovar.org
-
Taco Hoekwater
-
The Thanh Han