[Tex/LaTex] How to insert an image in the footline of a beamer presentation

beamergraphicsheader-footer

I'm using the Madrid theme but I would like tu use images instead of colored backgrounds for the frametitle and the footline. This is what I have so far

enter image description here

I want to do the same thing I did for the frametitle in the footline. I've tried many things, the only one that has worked is

\setbeamertemplate{footline}[textline]{
\includegraphics[width=\paperwidth]{image}}

but I can't fill the width of the page nor move the image, and the text is covered by the image. This is an example of what i just described

\documentclass{beamer}
\mode<presentation>{
  \usetheme{Madrid}
  \setbeamercolor{frametitle}{fg=yellow}
  \setbeamercolor*{palette primary}{use=structure,fg=red}
  \setbeamercolor*{palette secondary}{use=structure,fg=red}
  \setbeamercolor*{palette tertiary}{use=structure,fg=red}
  \setbeamerfont{frametitle}{size=\huge}
}
\usepackage{textpos}
\usepackage{graphicx}
\usepackage{tikz}
\usepackage[export]{adjustbox}

\setbeamertemplate{footline}[text line]{
\includegraphics[width=\paperwidth]{foot_image}}

\addtobeamertemplate{frametitle}{
\begin{textblock*}{\paperwidth}(-30pt,0pt)
\includegraphics[width=1.1\paperwidth,height=1.3cm]{frametitle_image}
\end{textblock*}
}

\title[Title]{\textbf{{\huge Big Title}}}
\author[email]{Author}
\institute[]{Department\\University}
\setbeamertemplate{navigation symbols}{}

\begin{document}

\begin{frame}{Frametitle}
slide 2
\end{frame}
\end{document}

Which produces

enter image description here

Best Answer

I thought much too complicate. A real easy way is just take your favourite image (I took https://apod.nasa.gov/apod/ap090707.html) remove the central part of the image with some graphic editor of your choice and include it as background image.

\documentclass{beamer}
\usetheme{Madrid}

\setbeamertemplate{background canvas}{%
    \includegraphics[width=\paperwidth,height=\paperheight]{m20_block}
}

\begin{document}

\begin{frame}{Frametitle}
slide 2
\end{frame}
\end{document}

enter image description here

Previous solution:

just add the image to the definition of the footline and use a negative vertical space to overlay the content of the footline over the image.

\documentclass{beamer}
\mode<presentation>{
  \usetheme{Madrid}
  \setbeamercolor{frametitle}{fg=yellow}
  \setbeamercolor*{palette primary}{use=structure,fg=red}
  \setbeamercolor*{palette secondary}{use=structure,fg=red}
  \setbeamercolor*{palette tertiary}{use=structure,fg=red}
  \setbeamerfont{frametitle}{size=\huge}
}
\usepackage{textpos}
\usepackage{tikz}
\usepackage[export]{adjustbox}

\makeatletter
\setbeamertemplate{footline}
{
  \leavevmode%
  \includegraphics[width=\paperwidth, height=1cm]{example-image}%NEW
  \vskip-10pt%NEW
  \hbox{%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
    \usebeamerfont{author in head/foot}\insertshortauthor\expandafter\beamer@ifempty\expandafter{\beamer@shortinstitute}{}{~~(\insertshortinstitute)}
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
    \usebeamerfont{title in head/foot}\insertshorttitle
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
    \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
    \insertframenumber{} / \inserttotalframenumber\hspace*{2ex} 
  \end{beamercolorbox}}%
  \vskip0pt%
}
\makeatother


\addtobeamertemplate{frametitle}{
\begin{textblock*}{\paperwidth}(-30pt,0pt)
\includegraphics[width=1.1\paperwidth,height=1.3cm]{example-image}
\end{textblock*}
}

\title[Title]{\textbf{{\huge Big Title}}}
\author[email]{Author}
\institute[]{Department\\University}
\setbeamertemplate{navigation symbols}{}

\begin{document}

\begin{frame}{Frametitle}
slide 2
\end{frame}
\end{document}

enter image description here

And you don't need \usepackage{graphicx} as beamer already provides these functionalities.

Related Question