\pdfximage : is there a transparency attribute or method ?
I am attempting to incorporate http://thai-an.co.uk/Resources/Graphics/thai-an-logo-no-phone.png as a background image in PdfTeX, and of course it is far too saturated to use as-is. While I could manipulate it in Photoshop or similar, I wonder if there is a more direct way whereby I can specify (say) its transparency in PdfTeX so as to effectively reduce its saturation ? Philip Taylor -- Not sent from my i-Pad, i-Phone, Blackberry, Blueberry, or any such similar poseurs' toy, none of which would I be seen dead with even if they came free with every packet of cornflakes.
I now see that CSS calls this "Opacity", so please interpret my earlier message as if it is the opacity of the logo that I wish to manipulate in PdfTeX, not its transparency. ** Phil.lakes.
On 4 January 2011 Philip Taylor (Webmaster, Ret'd) wrote:
I am attempting to incorporate
http://thai-an.co.uk/Resources/Graphics/thai-an-logo-no-phone.png
as a background image in PdfTeX, and of course it is far too saturated to use as-is. While I could manipulate it in Photoshop or similar, I wonder if there is a more direct way whereby I can specify (say) its transparency in PdfTeX so as to effectively reduce its saturation ?
Hi Phil, sorry, $ wget http://thai-an.co.uk/Resources/Graphics/thai-an-logo-no-phone.png --2011-01-04 19:37:39-- http://thai-an.co.uk/Resources/Graphics/thai-an-logo-no-phone.png Resolving thai-an.co.uk... 93.97.166.234 Connecting to thai-an.co.uk|93.97.166.234|:80... failed: Connection timed out. Retrying. --2011-01-04 19:40:49-- (try: 2) http://thai-an.co.uk/Resources/Graphics/thai-an-logo-no-phone.png Connecting to thai-an.co.uk|93.97.166.234|:80... failed: No route to host. Same results with http://www.downforeveryoneorjustme.com 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 -- ---------------------------------------------------------------------------- Reinhard Kotucha Phone: +49-511-3373112 Marschnerstr. 25 D-30167 Hannover mailto:reinhard.kotucha@web.de ---------------------------------------------------------------------------- Microsoft isn't the answer. Microsoft is the question, and the answer is NO. ----------------------------------------------------------------------------
Oops, DNS error. (I must have forgotten to update it when the server changed homes). Hopefully correct soon. ** P. -------- Reinhard Kotucha wrote:
$ wget http://thai-an.co.uk/Resources/Graphics/thai-an-logo-no-phone.png --2011-01-04 19:37:39-- http://thai-an.co.uk/Resources/Graphics/thai-an-logo-no-phone.png Resolving thai-an.co.uk... 93.97.166.234 Connecting to thai-an.co.uk|93.97.166.234|:80... failed: Connection timed out.
Reinhard/all -- DNS should be OK now (W3C validator can see site);
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. ** Phil.
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 --
Heiko Oberdiek wrote:
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
Thank you, Heiko : would you have any idea how to express this using just PdfTeX primitives ? I do not use LaTeX for ever-day work. My current code looks like this (relevant parts only) %\pdfimageapplygamma = 1 %\pdfgamma = 2200 \immediate \pdfximage width \hsize {TA-logo.png} \setbox 0 = \vtop {\pdfrefximage \pdflastximage} \box 0 \kern -\vsize -- Not sent from my i-Pad, i-Phone, Blackberry, Blueberry, or any such similar poseurs' toy, none of which would I be seen dead with even if they came free with every packet of cornflakes.
On Tue, Jan 04, 2011 at 09:39:27PM +0000, Philip Taylor (Webmaster, Ret'd) wrote:
Heiko Oberdiek wrote:
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}
Thank you, Heiko : would you have any idea how to express this using just PdfTeX primitives ?
pdftex.def tells you (also graphicx could be used in plain TeX using miniltx.tex): \usepackage{graphicx} \let\orgpdfximage\pdfximage \def\pdfximage#1#{% \typeout{\string\pdfximage\space#1{...}}% \orgpdfximage#1% }
\immediate \pdfximage width \hsize {TA-logo.png}
\immediate\pdfximage width\hsize attr{/Decode[.5 1 .5 1 .5 1]}% {TA-logo.png}% Yours sincerely Heiko Oberdiek --
A supplementary question, if I may ? The PdfTeX reference manual as found at Tug.Org has Chapter Eight entitled "Graphics and color", yet the chapter seems not to mention colour at all and focuses solely on graphics. Section 7.12 says "\pdfliteral [ <pdfliteral spec> ] <general text> Like \special in normal TEX, this command inserts raw pdf code into the output. This allows support of color and text transformation." but as far as I can tell, there are no examples of suitable parameters for affecting the colour of (e.g.) rendered text. May I ask if there is a supplementary manual that defines how colour is to be programmed through PdfTeX ? ** Phil.
On Tue, Jan 04, 2011 at 11:09:05PM +0000, Philip TAYLOR (Webmaster, Ret'd) wrote:
A supplementary question, if I may ? The PdfTeX reference manual as found at Tug.Org has Chapter Eight entitled "Graphics and color", yet the chapter seems not to mention colour at all and focuses solely on graphics. Section 7.12 says "\pdfliteral [ <pdfliteral spec> ] <general text> Like \special in normal TEX, this command inserts raw pdf code into the output. This allows support of color and text transformation." but as far as I can tell, there are no examples of suitable parameters for affecting the colour of (e.g.) rendered text. May I ask if there is a supplementary manual that defines how colour is to be programmed through PdfTeX ?
Again, it's implemented in pdftex.def, look for \pdfcolorstack... Color parameters are specified in the PDF specification. Yours sincerely Heiko Oberdiek --
Heiko Oberdiek wrote:
Again, it's implemented in pdftex.def, look for \pdfcolorstack... Color parameters are specified in the PDF specification.
Yours sincerely Heiko Oberdiek
Thank you once again, Heiko (and also Paul, for the immediately preceding reply). ** Phil. -- Not sent from my i-Pad, i-Phone, Blackberry, Blueberry, or any such similar poseurs' toy, none of which would I be seen dead with even if they came free with every packet of cornflakes.
Philip TAYLOR (Webmaster, Ret'd) wrote:
A supplementary question, if I may ? The PdfTeX reference manual as found at Tug.Org has Chapter Eight entitled "Graphics and color"
whereas the version to be found on CTAN at ftp://ctan.tug.org/tex-archive/systems/pdftex/pdftex-a.pdf has Chapter Eight entitled solely "Graphics" and is apparently of a much more recent vintage
November 23, 2010 Rev. 655
compared to
January 25, 2007 Rev. 1.675
at http://www.tug.org/texmf-dist/doc/pdftex/manual/pdftex-a.pdf So : a couple of questions. 1) What is the rationale for the change in version numbering, from 1.671 (January 2007) and 1.675 (also January 2007) to 655 (November 2010). It is certainly not easy to compare these two numbers, in the absence of the corresponding dates. 2) Is there any obvious reason why the TUG copy is so out-of-date ? Although Google search results are not entirely consistent, repeated tests have shewn that it has a marked preference for displaying the TUG copy well above the CTAN copy, and therefore most users could reasonably be expected to fetch their copy from TUG rather than from CTAN (as did I, whence my original surprise that a Chapter entitled "Graphics and Colour" should have nothing to say about colour). ** Phil. -- Not sent from my i-Pad, i-Phone, Blackberry, Blueberry, or similar such poseurs' toy, none of which would I be seen dead with even if they came free with every packet of cornflakes.
2011/1/5 Philip TAYLOR (Webmaster, Ret'd)
1) What is the rationale for the change in version numbering, from 1.671 (January 2007) and 1.675 (also January 2007) to 655 (November 2010). It is certainly not easy to compare
A switch from CVS to SVN. Best Martin
2) Is there any obvious reason why the TUG copy is so out-of-date ? Yes. tug.org/texmf-dist links to the TL 2010 release, not the TL development sources. It exists solely to avoid some broken links for online TL doc and was never intended to be a "known current repository" to peruse -- that's what CTAN (and TL development) is for. It is not explicitly advertised anywhere on tug.org. Since Google is preferring it, I guess I'll have to do something else. I think I'll start by telling Google not to index it. Best, k
participants (6)
-
Heiko Oberdiek
-
karl@freefriends.org
-
Martin Schröder
-
Philip TAYLOR (Webmaster, Ret'd)
-
Philip Taylor (Webmaster, Ret'd)
-
Reinhard Kotucha