18

I want to add a background image in my beamer presentation. The thing is that when I use

\usebackgroundtemplate{
\includegraphics[width=\paperwidth,
height=\paperheight]{cern-logo.jpg}
}

in my preamble, the image has its true colors, meaning that it is not opaque or transparent. Is there a way to achieve that?

  • Looks like I don't really get your point. If the image was to be transparent, what would you expect to see through the transparent areas? As you also don't give any MWE we can only guess, if the background color is different from white. Above that you give in your code a .jpg image, but jpg does not support transparency. – Benedikt Bauer Sep 25 '12 at 13:14
  • 1
    All I wanted to do was to change the opacity, but I didn't know how to express it! Sorry for the inconvinience :( – Thanos Sep 25 '12 at 13:34
  • 3
    Don't worry. As long as you try to help us by answering additional questions we'll try to help you even if you missed something in your initial post that might have been unimportant from your point of view but turned out to be important to answer your question. – Benedikt Bauer Sep 25 '12 at 16:12
  • You are so nice! Thank you very much for the understanding! – Thanos Sep 26 '12 at 12:14
32

You can use TikZ to place the image in a \node with the desired opacity:

\documentclass{beamer}
\usepackage{tikz}

\usebackgroundtemplate{%
\tikz\node[opacity=0.3] {\includegraphics[height=\paperheight,width=\paperwidth]{ctanlion}};}

\begin{document}

\begin{frame}
CTAN lion drawing by Duane Bibby.
\end{frame}

\end{document}

enter image description here

In this case, it might be convenient to use \pgfdeclareimage, \pgfuseimge:

\pgfdeclareimage[height=\paperheight,width=\paperwidth]{myimage}{cern-logo.jpg}
\usebackgroundtemplate{\tikz\node[opacity=0.3] {\pgfuseimage{myimage}};}
  • It's working!!! Thank you very much for your time!!! – Thanos Sep 25 '12 at 13:33
  • Can you explain the reason why "semi-colon" separating the triple curly brace? – Say OL Sep 2 '13 at 16:52
  • 1
    @SayOL It's TikZ syntax; \node (and all other drawing TikZ commands) end with a semi-colon. – Gonzalo Medina Sep 2 '13 at 17:20
  • 1
    This is leaving a small white margin on the left and top of the page. Ideas? – SabreWolfy Oct 30 '13 at 10:48
  • 6
    @SabreWolfy This is caused by the default padding of the node. Just replace \node[opacity=0.3] by \node[opacity=0.3,inner sep=0]. – Michal Kaut Dec 3 '13 at 12:05

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.