If you have access to it, I would use the pdftoppm util which is part of the poppler utilities for manipulating pdf files.
(I am not sure what you meant by having the left and right page "sticked".)
Taking your example file (which I name as testpng.tex) I can run
which generates the pages as PDFs. Then I run
pdftoppm -png ...
This shows one way to insert a cropped image into a hole in another image.
The saveboxes give us the dimensions of the images in something other than pixels. The scope is used simply to make the clip local. The \fill is there just to show were the hole is.
Note that the clip is defined an terms of the hole in A. All you have to do is move image B ...
You can use the png/jpg image directly and adjust the size and the color to the current font.
The current font size is stored in the macro \f@size which can be used as height attribute for \includegraphics.
The colors of an included image can be modified by specifying the decodearray attribute to \includegraphics. This array contains two multiplication ...