I have a canvas that has a width of w and a height of h. I'm trying to fit my (1000 x 800) image on it using image = image.zoom(w).subsample(800)
. But it's giving me the error: _tkinter.TclError: not enough free memory for image buffer
. Can someone please help?
When you call zoom
, the first parameter specifies how much to multiply each pixel by. If you only provide an x
value, the y
value will be the same as the x
value. Thus, if w
is 1000, zoom(x)
will attempt to create an image that is one million pixels wide by 800,000 pixels tall. That's nearly a terabyte of image data.