GSIV and the Python Imaging Library dying on large image
Summary: The GSIV tilemaker.py script dies when attempting to create a large (16384×16384) blank PIL Image object, simply saying “Killed“. The only solution I’ve found is to resize the image to below 8192×8192 before running the script.
Problem: I’m trying to use the Giant Scalable Image Vector (GSIV) to make a Google Maps-like browser for a topographical map. The tilemaker.py script dies, outputting:
original size: (11096, 11721)
Killed
Solution:I resized the topo to a width of 8192 in GraphicConverter, though any image editing software should work.
Discussion: GSIV tilemaker.py uses the Python Imaging Library to split and resize the image that will be viewed. During execution, the script attempts to create a new Image object that is sized to a power of two large enough to fit the original image, followed by paste-ing in the original graphic.
In this case, the original image is quite large (11096×11721). The image that it tries to create is therefore 16384×16384, which causes the script to end abruptly, saying only “Killed“. This probably indicates that the script was consuming too much memory, and was forcebly killed by the Python interpreter.
I don’t know very much about Python, so I decided to resize the image canvas manually, then hack the script to not try. Unfortunately, GraphicConverter was unable to resize up to 16384×16384, giving the error message
System error "Size Check failed (-116)" occurred in document
Instead, I was forced to resize the image down to a width of 8192, whereupon the tilemaker.py script was able to run without a problem.
You can see the result of my efforts here.