23

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?

Thanos
  • 12,446
  • 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
  • 2
    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

2 Answers2

44

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}};}
Gonzalo Medina
  • 505,128
0

In my case I wanted to completely remove the white background to convert it to a transparent png.

  • in the latex, use \usebackgroundtemplate{}
  • run convert -density 300 input.png -resize 1920x1080 -channel rgba -channel A -evaluate multiply 0.97 +channel output.pdf

the .97 is because I wanted the image to be slightly transparent even for opaque stuff, but you can set it to 1 to get a normal opaque color for opaque parts of the picture.

tobiasBora
  • 8,684