8

I would like to add a semi-transparent background to an eps figure in beamer. The picture itself has transparent background. I want to add the semi-transparant background as I use the tikz package to overlap it with a first figure whose overlaped parts should still be visible. Here is the code I have so far:

\begin{frame}{}
    \begin{itemize}
        \item item
        \begin{tikzpicture}
            \node (img1) {\includegraphics[height=0.4\textwidth]{figure1}};
            \visible<2>{\node (img2) at (img1.south east){\includegraphics[height=0.4\textwidth]{figure2}};}
        \end{tikzpicture}
    \end{itemize}
\end{frame}
0

1 Answer 1

8

I am not sure of having understood your question correctly. Hence this is shooting blindfolded. Do you mean some thing like this?

You can use opacity=<value>. The MWE is :

\documentclass{beamer}
\usepackage{tikz}
\begin{document} 
\begin{frame}{}
    \begin{itemize}
        \item item
        \begin{tikzpicture}
            \node (img1) {\includegraphics[height=0.4\textwidth]{example-image-a}};
            \visible<2>{\node[opacity=0.7] (img2) at (img1.south east){\includegraphics[height=0.4\textwidth]{example-image-b}};}
        \end{tikzpicture}
    \end{itemize}
\end{frame}
\end{document}

enter image description here

For me both the images A and B do not have transparent background. Since your image is already having a transparent backgound, I have no idea of how it will be. Please feed back.

Edit:

Following the comments, this is the next guess in trying to accomplish the goal.

\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}{}
    \begin{itemize}
        \item item
        \begin{tikzpicture}
            \node (img1) {\includegraphics[height=0.4\textwidth]{example-image-a}};
            \visible<2>{\node[opacity=0.9,fill=red!90] (img2) at (img1.south east) {\phantom{\includegraphics[height=0.4\textwidth]{tansparent}}};
            \node (img2) at (img1.south east) {\includegraphics[height=0.4\textwidth]{tansparent}};}
        \end{tikzpicture}
    \end{itemize}
\end{frame}
\end{document}

Here an articial bounding box is used with the help of \phantom.

enter image description here

6
  • No, thats not what I want. I want that figure2 is completely visible (opacity 1). But figure2 has now a completely transparent background. Hence figure1 is visible too. But I want to cover figure1 partly so there is no confusion between the two. In other words: your guess is good except: the letter B should be visible with opacity 1. And my figure 2 does not have a background now so I want to add a transparent one.
    – highsciguy
    Commented Jun 5, 2012 at 23:34
  • Thats the good direction. figure2 gets a white background now which hides (as it should) the overlap of figure1. However for me the background appears completely opaque so that the overlap of figure1 is completely invisible...
    – highsciguy
    Commented Jun 5, 2012 at 23:59
  • @highsciguy: I don't have a transparent picture. Hence I am not able to test anything. What I can do is only guessing. Posting your second image will make my life easier.
    – user11232
    Commented Jun 6, 2012 at 0:04
  • I cannot post it as an image. Format not supported. Can I upload a file somehow?
    – highsciguy
    Commented Jun 6, 2012 at 0:20
  • Not necessary. Your last edit works, except for the color:)
    – highsciguy
    Commented Jun 6, 2012 at 0:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .