1

I am writing a technical report with a background figure on the cover. I want to add a fade-out effect to the image and I have found this answer How to add a gradient fade-out effect to an image? but with the beamer class.

Is there a way to have the same effect with the article class?

My MWE is the following:

\documentclass[12pt,twoside,titlepage]{article}
\usepackage{graphicx}
\usepackage{eso-pic}
\newcommand\BackgroundPic{%
\put(0,0){%
\parbox[b][\paperheight]{\paperwidth}{%
\vfill
\centering
\includegraphics[width=\paperwidth,height=\paperheight,%
keepaspectratio]{Textura.pdf}%
\vfill
}}}

\begin{document} 
\begin{titlepage}
\AddToShipoutPicture*{\BackgroundPic}
\end{titlepage}
HOLA

\end{document}

Thank you

user151562
  • 630
  • 5
  • 19

1 Answers1

3

You can use the same code as in the beamer example. The relevant piece of code is the tikzpicture environment, where the image and the fade-out is specified. This code uses the tikz package and the fadings library for TikZ, which you have to add in the preamble (at the start of the code, between the documentclass and \begin{document}).

MWE:

\documentclass[12pt,twoside,titlepage]{article}
\usepackage{graphicx}
\usepackage{eso-pic}
\usepackage{tikz}
\usetikzlibrary{fadings}
\newcommand\BackgroundPic{%
\begin{tikzpicture}
\path (0,0) rectangle (\paperwidth,\paperheight);
\node[scope fading=west,inner sep=0pt,outer sep=0pt,anchor=north east] at(\paperwidth,\paperheight) {\includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{example-image-c}};
\end{tikzpicture}
}

\begin{document} 
\begin{titlepage}
\AddToShipoutPicture*{\BackgroundPic}
\end{titlepage}
HOLA

\end{document}

Result:

enter image description here

Marijn
  • 37,699