[Tex/LaTex] How to add a transparent logo to the top sidebar of beamer

graphicstransparent

This is the code for beamer's sidebar:

\documentclass{beamer}
\usepackage{tikz,graphicx} 

\title{Title}
\author{My name}
\institute{My institute}

\useoutertheme[right,height=0pt,width=0.12\paperwidth]{sidebar}
\setbeamertemplate{sidebar canvas right}[horizontal shading]    [left=blue!10!white,right=white] 

\makeatletter
\addtobeamertemplate{sidebar right}{}{%
\begin{tikzpicture}[remember picture,overlay] % 
    \node[anchor=north east,xshift=0.8pt,yshift=2pt] at (current page.north east) {\includegraphics[width=0.11\paperwidth]{logo.png}};
\end{tikzpicture}
}
\makeatother

\begin{document}
\begin{frame}[plain]
\titlepage
\end{frame}

\begin{frame}
Frame content
\end{frame}

\end{document}

I want the logo image file(logo.png) to be transparent at the top of the sidebar and not cover the texts, what should I do?

Best Answer

The jpg format has no idea of what transparency is. If you create a png image with a proper alpha (transparent) layer, it should simply work.

I have

\addtobeamertemplate{frametitle}{}{%
\begin{textblock*}{100mm}(.98\textwidth,0.1cm)
    \includegraphics[height=0.9cm]{logo-eb}
\end{textblock*}}

(using \usepackage[absolute,overlay]{textpos}) and it works nicely:

enter image description here

(and the image is a .png with the parts external to the circle marked as transparent).

enter image description here

update

With the new MWE, and your logo, the result is satisfactory:

enter image description here

If you want that also the orange part (which is not transparent in the .png) you can

  1. edit the PNG image so that it is partially transparent, or

  2. add opacity like this:

       \node[anchor=north east,xshift=0.8pt,yshift=2pt,
        opacity=0.3] at (current page.north east) {\includegraphics[width=0.11\paperwidth]{logo.png}};
    

    to obtain:

    enter image description here

  3. and/or move the logo down (for example with yshift=-0.11\paperwidth:

    enter image description here