[Tex/LaTex] Background pattern for equations (to defeat PhotoMath)

backgroundsequationspattern

I'm a math teacher and I'm dealing with the problem of doing math tests with my students at home. I recently found out that there are certain background patterns that can prevent apps like PhotoMath to read math equations/problems (you can see an example in Edia website) and I'd like to implement something like that in LaTeX.
To be clear, I'd like some variation of the equation ambient which automatically add said background and change the text colour. I have an image of the pattern I'd like to use (see below), but I don't know where to start. I'm not asking for a code solution, I ask you to kindly point me to the right direction: which package(s) should I use? is it better to build the pattern within LaTeX or is it possible to use the image directly?

Thank you for your kind reply. I will edit this post with a MWE as soon as i will be able to produce one.

enter image description here

Best Answer

You can use the combination of tcolorbox and empheq. Here is an example in which I am probably overdoing it a bit, but it is easier to drop options than to add them.

\documentclass{article}
\usepackage[skins,theorems]{tcolorbox}
\usetikzlibrary{patterns.meta}
\usepackage{empheq}
\newcommand{\diff}{\mathop{}\!\mathrm{d}}
\newtcbox{\otherbox}[1][]{nobeforeafter,math upper,tcbox raise base,
enhanced,frame hidden,boxrule=0pt,interior style={top color=green!10!white,
bottom color=green!10!white,middle color=green!50!yellow,
postaction={pattern={Hatch[angle=45,distance={3pt/sqrt(2)},xshift=.1pt]}, 
pattern color=blue}}, fuzzy halo=1pt with
green,#1}
\begin{document}
\begin{empheq}[box=\otherbox]{align} a&=\sin(z)\\
E&=mc^2 + \int_a^b x\diff x
\end{empheq}
\end{document}

enter image description here