[texhax] [NTG-pdftex] \pdfximage : is there a transparency attribute or method ?

Heiko Oberdiek heiko.oberdiek at googlemail.com
Tue Jan 4 22:27:06 CET 2011


On Tue, Jan 04, 2011 at 07:55:19PM +0000, Philip Taylor (Webmaster, Ret'd) wrote:

> >However, you can probably apply ICC profiles, but this looks
> >non-trivial.  The IIC file in the pdftex samplepdf directory is a
> >binary file.  Maybe it's possible to apply ICC data in ASCII format,
> >but I just found a simpler solution:
> >
> >   sam2p thai-an-logo-no-phone.png thai-an-logo-no-phone.eps
> >
> >In the EPS file, immediately after the lines beginning with %%, add
> >the line
> >
> >{ .33 exp } dup dup currenttransfer setcolortransfer
> >
> >and then run
> >
> >   epstopdf thai-an-logo-no-phone.eps
> >
> >I get acceptable results with the JPG file I used for testing, but
> >you probably have to experiment with the transfer function.
> >
> >The first occurrence of the function denotes the transfer function for
> >the red part of the image.  Because we need the same function for all
> >three colors, we simply duplicate it twice on the stack.
> >
> >Regards,
> >   Reinhard
> 
> Eee, that is a complex solution !  Many thanks, Reinhard, but
> for now I will stick with my CSS hack and hope that Thanh or
> someone else knows if this is actually addressed within
> the PdfTeX engine.

The PDF specification knows a decode array, see section
"Decode Arrays" in chapter "4.8.4 Image Dictionaries".
pdftex.def supports it by option decodearray,
added in version 2010/09/09 v0.05a

Example:

\documentclass[a4paper]{article}
\usepackage{graphicx}
\begin{document}
\includegraphics[
  decodearray=.5 1 .5 1 .5 1
]{thai-an-logo-no-phone}% image with RGB colors
\end{document}

Yours sincerely
  Heiko Oberdiek
-- 


More information about the texhax mailing list