Is it possible to use a PNG image as a background, but with selected opacity? It seems to me that standard solutions found here can not change opacity of PNG...

I assume, that in the following one of the flags should be near transparent (taken from Includegraphics: set image opacity):







but the result is:

enter image description here

where it.png is

enter image description here

  • Yes it is possible. Here is an example of using a background image with opacity: Background images for code listings. We'd really have to see a MWE to figure out why what you tried did not work for you. – Peter Grill May 18 '13 at 5:03
  • @PeterGrill It is rather MNWE (minimal non working example). – Przemysław Scherwentke May 18 '13 at 5:46
  • That depends on whether Peter means the document is working, or that the error is working...:) – John Wickerson May 18 '13 at 8:03

You just have to run pdflatex twice for the transparency to kick in for your original tex source. The package actually prints out a message to say that when you run it the first time.


As a fan of both tikz and background, here's a version showing four different opacities:




            \node[opacity=\myopacity] {\includegraphics[scale=1]{avatar.png}};





enter image description here

  • I have obtained: "! LaTeX Error: Unknown option angle=0' for package background'." and so on. :-( – Przemysław Scherwentke May 18 '13 at 17:33
  • @PrzemysławScherwentke: Which version do you use? I used the v2.0 natation, which is not compatible with v1.0. There you used \SetBgContents{} \SetBgColor{} \SetBgAngle{} \SetBgOpacity{} \SetBgScale{} \SetBgPosition{} \SetBgAnchor{} \SetBgHshift{} \SetBgVshift{}. Either change to the old syntax or upgrade to v2.0 (if that is the problem). – Tom Bombadil May 18 '13 at 19:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.