I just spent an hour trying to get rmarkdown:beamer_presentation to display a PNG image that fills the whole slide, i.e. without any white borders. The use case is having a regular beamer presentation with bulleted slides that have titles, sections etc, but having some slides in my presentation that only contain a full screen image or photo.
Using the example code duck.Rmd below (I used google to search for a duck.png image) I managed to eliminate three of the four white borders, leaving only the left border:
---
title: "Duck"
author: "Gertjan Verhoeven"
date: "3/6/2022"
output: beamer_presentation
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
---
\includegraphics[width=\paperwidth, height=\paperheight]{duck.png}}
Knitting this file to PDF (Beamer) in Rstudio with TeX installed gives me this slide:

Any idea what to do to completely remove all white borders and stretch the image to completely cover the slide? While staying in the Rstudio / Knit to PDF (Beamer) / rmarkdown::beamer_presentation framework?
