[Tex/LaTex] Image behind and beyond crop marks

cropgraphicsmemoir

This is what I'm trying to do… Please note that the images that will be used in the final version are of slightly uneven size, so that should ideally be taken into account. I've been through the usual suspects and hope someone can help!

Normal pages should look like this:

enter image description here

Pages with a background image (and no text whatsoever) like this:

enter image description here

Close up, notice the crop marks:

enter image description here

I'm using memoir with showtrims (custom page size), here's an MWE in just in case…

\documentclass[book,openany,showtrims]{memoir}
%  Crop settings via  http://latex-my.blogspot.dk/2009/10/setting-page-size -and-margins.html

%% The stock paper size
\setstocksize{236mm}{161mm}

%% The 'real' page size
\settrimmedsize{230mm}{155mm}{*}

%% The stock paper will be trimmed 3mm from the
%% top edge and 3mm from the left edge
\settrims{3mm}{3mm}

%% Spine and trim page margins from main typeblock
\setlrmarginsandblock{20mm}{15mm}{*}

%% Top and bottom page margins from main typeblock
\setulmarginsandblock{20mm}{20mm}{*}

%% Header occupies height of a single line;
%% Bottom edge of footer is 7mm from bottom edge
%% of typeblock
\setheadfoot{\baselineskip}{7mm}

%% Bottom edge of header is 7mm from top edge of
%% typeblock
\setlength\headsep{7mm}

\checkandfixthelayout

\usepackage[utf8]{inputenc}
\usepackage[danish]{babel}
\begin{document}
 Bla
\end{document}

Best Answer

Here's a possible solution. The "behind" part of the question is addressed in SNIPLET C.5 (BACKGROUND IMAGE AND TRIMMARKS) of the memoir manual:

This sniplet comes from another problem described in CTT. If one use the eso-pic package to add a background image, this image ends up on top of the trim marks. To get it under the trim marks Rolf Niepraschk suggested the following trick

\RequirePackage{atbegshi}\AtBeginShipoutInit
\documentclass[...,showtrims]{memoir}
...
\usepackage{eso-pic}
...

The "beyond" part can be solved using TikZ and its current page node. I defined a command \AddBackground to be placed on those pages where the background should appear (according to a comment to the question, these pages are manually created).

The code:

\RequirePackage{atbegshi}
\AtBeginShipoutInit
\documentclass[book,openany,showtrims]{memoir}

\setstocksize{236mm}{161mm}
\settrimmedsize{230mm}{155mm}{*}
\settrims{3mm}{3mm}
\setlrmarginsandblock{20mm}{15mm}{*}
\setulmarginsandblock{20mm}{20mm}{*}
\setheadfoot{\baselineskip}{7mm}
\setlength\headsep{7mm}
\checkandfixthelayout

\usepackage{eso-pic}
\usepackage{tikz}
\usepackage{lipsum}

\definecolor{bgcolor}{RGB}{220,123,228}

\newcommand\AddBackground{%
\AddToShipoutPictureBG*{%
\AtPageCenter{%
\tikz[remember picture,overlay]
\fill[bgcolor] 
  ([xshift=5pt,yshift=5pt]current page.south west) 
  rectangle 
  ([xshift=12pt,yshift=12pt]current page.north east);}}%
}

\begin{document}

\lipsum[1-4]
\clearpage
\AddBackground%
\null\vfill
{\centering\Huge IMAGE\par}
\vfill
\clearpage
\lipsum[1-4]

\end{document}

enter image description here

A close-up showing the desired positioning of the background with respect to the crop marks:

enter image description here

Of course, the same principle can be applied with an included image:

\RequirePackage{atbegshi}
\AtBeginShipoutInit
\documentclass[book,openany,showtrims]{memoir}

\setstocksize{236mm}{161mm}
\settrimmedsize{230mm}{155mm}{*}
\settrims{3mm}{3mm}
\setlrmarginsandblock{20mm}{15mm}{*}
\setulmarginsandblock{20mm}{20mm}{*}
\setheadfoot{\baselineskip}{7mm}
\setlength\headsep{7mm}
\checkandfixthelayout

\usepackage{eso-pic}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{lipsum}

\begin{document}

\lipsum[1-4]
\clearpage
\null\AddToShipoutPictureBG*{%
\tikz[remember picture,overlay]
\node at ([xshift=8pt,yshift=8.5pt]current page.center)
  {\includegraphics[width=\dimexpr\paperwidth+10pt\relax,height=\dimexpr\paperheight+10pt\relax]{example-image-a}};}
\clearpage
\lipsum[1-4]

\end{document}

enter image description here

And a close-up:

enter image description here