I am using wand and pytesseract to get the text of pdfs uploaded to a django website like so:
image_pdf = Image(blob=read_pdf_file, resolution=300)
image_png
I run into a similar issue.
Found this page interesting: http://www.imagemagick.org/script/architecture.php#tera-pixel
And how to limit the amount of memory used by ImageMagick through wand: http://docs.wand-py.org/en/latest/wand/resource.html
Just adding something like:
from wand.resource import limits
# Use 100MB of ram before writing temp data to disk.
limits['memory'] = 1024 * 1024 * 100
It may increase the computation time (but like you, I don't mind too much) and I actually did not notice so much difference.
I confirmed using Python's memory-profiler that it is working as expected.