precisely position and crop images on beamer slide using polygonal contours

I would like to achieve slides like this:

So far I have learned how to cut images using polygonal paths and how to create frames without any margin.

However I could not manage to combine the two in order to get the desired output.

My MWE is as follows, images can be retrieved here and here.

\documentclass{beamer}
\usepackage{tikz}

\begin{document}

\begin{frame}[plain,b]
\begin{tikzpicture}[remember picture, overlay]
\clip (0\paperwidth,0\paperheight)--(0.4\paperwidth,0\paperheight)--(0.6\paperwidth,1\paperheight)--(0\paperwidth,1\paperheight)--cycle;
\node[anchor=south west] at (0,0) {\includegraphics[width=\paperwidth]{photo-1463595373836-6e0b0a8ee322.jpeg}};
\end{tikzpicture}
\end{frame}

\end{document}


Thank you!

Instead of paperwidth and papweheight, I've used current page anchors and calc tikzlibrary to define the clipping path.

Instead of width as scale factor for both images, I've used height because otherwise they were not tall enough to cover the slide.

Finally inner sep=0pt was fixed to avoid white margin around figures.

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}

\begin{frame}[plain,b]
\begin{tikzpicture}[remember picture, overlay]
\begin{scope}
\clip (current page.south west)|-
($(current page.north west)!0.6!(current page.north east)$) --
($(current page.south west)!0.4!(current page.south east)$) --
cycle;
\node [anchor=south west, inner sep=0pt] at
(current page.south west)
{\includegraphics[height=\paperheight]{photo-1463595373836-6e0b0a8ee322.jpg}};
\end{scope}
\begin{scope}
\clip (current page.south east)|-
($(current page.north west)!0.6!(current page.north east)$) --
($(current page.south west)!0.4!(current page.south east)$) --
cycle;
\node[anchor=south west, draw, inner sep=0pt]
at (current page.south west)
{\includegraphics[height=\paperheight]{photo-1464013778555-8e723c2f01f8.jpg}};
\end{scope}
\end{tikzpicture}
\end{frame}

\end{document}


using 15.6 Generalized Filling: Using Arbitrary Pictures to Fill a Path, I manage to do :

\documentclass{beamer}
\usepackage{tikz}
\usepackage{mwe}

\begin{document}

\begin{frame}[plain,b,fragile]
\begin{tikzpicture}[path image/.style={
path picture={
\node at (path picture bounding box.center) {
\includegraphics[width=\paperwidth]{#1}
};}}]
\draw [path image=example-image-a] (0,0)--(0.4\paperwidth,0\paperheight)--(0.6\paperwidth,\paperheight)--(0\paperwidth,\paperheight)--cycle;

\draw [path image=example-image] (0.4\paperwidth,0\paperheight)--(\paperwidth,0\paperheight)--(\paperwidth,\paperheight)--(0.6\paperwidth,\paperheight)--cycle;
\end{tikzpicture}
\end{frame}

\end{document}


• Try with fragile as frame option. Jun 3 '16 at 16:08
• this one is nicely concise, but I don't actually want the margin on the left Jun 4 '16 at 14:44
• @Bastian Yes, but I don't understand why there is this margin.
– flav
Jun 5 '16 at 6:28