[Image-SIG] MemoryError when i create a big image

Lino Mastrodomenico l.mastrodomenico at gmail.com
Fri Mar 7 08:07:57 CET 2008


2008/3/3, Juanmi <juanmiguel.sanchezacosta at gmail.com>:
> I need create a big bmp image (b/n) with width 64000 pixels and height:48000
> pixels, but when i try it, PIL return a memory error.
> This image should have around 350MB so i dont understand the memory error.

PIL uses one byte per pixel even for type '1' images, so this requires
almost 3 GB of memory.

> Someone can help me? Maybe is Windows?
>
> Code:
>
> import Image
> white_img = Image.new ('1', (64000,48000),(1))
> white_img.save('white.bmp')

This works fine on my AMD64 GNU/Linux laptop. You simply need a 64 bit
architecture and/or a better operating system.

-- 
Lino Mastrodomenico
E-mail: l.mastrodomenico at gmail.com


More information about the Image-SIG mailing list