INTRODUCTION
I am trying to fill the background of a LaTeX document with an imported background image.
The background image is in .png format.
Thus far, my code rotates the image, which I do not want.
Also, the scaled-up background image which goes off the edges of the page, which I also do not want.
Ideally, the background image will fit inside of the page boundaries.
A similar question was asked before. However, that user was okay with their picture going off the edges. They wanted the smallest background image possible which still managed to cover/coat the entire page. That is, the found the smallest scaling factor possible such that both of the following conditions we satisfied:
- the background image width was at least as wide as the page width
- the background image height was at least as tall as the page height.
I want to find the largest background image such that the image height and width are less than the page height and width.
I am okay having a "white border" at the top/bottom, or left/right sides of the background.
SOURCE CODE
My source code is provided below:
\documentclass[12pt]{article}
\usepackage{graphicx}
\graphicspath{ {./images/} }
\usepackage{graphicx}
\usepackage{background}
\backgroundsetup{contents=\includegraphics{bkrnd.png}}
\begin{document}
The universe is immense and it seems to be homogeneous,
in a large scale, everywhere we look at.
mood when there is a subject topic
or WH-phrase.
\end{document}
I require the the following:
- The background image is un-tilted (not-rotated)
- The background image fully opaque, not washed-out.
- The background image does not go off the edges of the page.
- The background image does not affect text-alignment.
- Text is not in-line with the background image.
- All of the document text appears on a layer above of the background image.
If you want it for testing purposes, I will provide bkrnd.png below:

