Having to put a background image for the title page of a book I've used the following lines in the preamble:
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage{xcolor}
\usepackage{graphics}
\usepackage{eso-pic}
\newcommand\BackgroundPic{%
\put(0,0){%
\parbox[b][\paperheight]{\paperwidth}{%
\vfill
\centering
\includegraphics[width=\paperwidth,height=\paperheight,%
keepaspectratio]{background.jpg}%
\vfill
}}}
and then this right after the \begin{document}
:
\AddToShipoutPicture*{\BackgroundPic}
(The code has been taken from here: How to create a background image on title page with LaTeX?)
The image was indeed loaded but it leaves a white border above and below, as you can see in the screenshot, which I would like to erase.
Can anyone help me?
keepaspectratio
option might be the culprit if the aspect ratio of your document and your image do not match.