I want to use a picture as a full-page background of a particular beamer slide.
I want the picture to fill the whole slide, but preserve its aspect ratio (which is different from that of the slide), in a manner that the picture gets centred (horizontally and vertically) on the slide and scaled up exactly to the point where the picture covers the whole slide (so the visible part gets cropped along the relatively longer side of the picture).
In other words, I want to replicate the "Fill Screen" behaviour commonly found for desktop backgrounds (such as in OS X).
What is a clean way to achieve the desired behaviour in beamer?
The following minimal working example
covers the background, but does not scale proportionally (first slide), or
scales the picture proportionally, but neither centres it, nor covers the whole background (second slide):
\documentclass{beamer}
\usepackage{graphicx}
\begin{document}
{\usebackgroundtemplate{%
\includegraphics[width=\paperwidth,height=\paperheight]{test.jpg}}
\begin{frame}
\end{frame}}
{\usebackgroundtemplate{%
\includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{test.jpg}}
\begin{frame}
\end{frame}}
\end{document}
Slide 1:
Slide 2:
Best Answer