[Image-SIG] Converting images to palette mode
Fredrik Lundh
fredrik at pythonware.com
Tue Jan 27 11:53:33 CET 2009
Does it always stop at the same image, or after roughly the same
number of images? Have you checked for memory/cpu consumption during
the conversion (in case it's a leak).
</F>
2009/1/26 Lukas Orsin <lukas.orsin at infinit.sk>:
> Hi,
> We are converting much images (296,000 tiles) at size 256x256px from RGB to
> Palette mode.
> After about 200,000 converted images our simple program crashes with
> quantization error:
>
> ..processing 129.png
> ..processing 130.png
> Traceback (most recent call last):
> File "C:\tmp\to8bit_folders_upgrade.py", line 35, in <module>
> os.path.walk(cesta,start_image_crush, 'blablabla')
> File "C:\ActivePython25\lib\ntpath.py", line 334, in walk
> walk(name, func, arg)
> File "C:\ActivePython25\lib\ntpath.py", line 334, in walk
> walk(name, func, arg)
> File "C:\ActivePython25\lib\ntpath.py", line 334, in walk
> walk(name, func, arg)
> File "C:\ActivePython25\lib\ntpath.py", line 334, in walk
> walk(name, func, arg)
> File "C:\ActivePython25\lib\ntpath.py", line 334, in walk
> walk(name, func, arg)
> File "C:\ActivePython25\lib\ntpath.py", line 328, in walk
> func(arg, top, names)
> File "C:\tmp\to8bit_folders_upgrade.py", line 29, in start_image_crush
> im=im.convert('P', palette=Image.ADAPTIVE, colors=colors)
> File "C:\ActivePython25\Lib\site-packages\PIL\Image.py", line 663, in
> convert
> im = self.im.quantize(colors)
> ValueError: quantization error
>
> Could anybody know whats the matter?
> We are running at Windows 2003 R2 SP2 32bit / 3.5 GB RAM
> and using os.path.walk funcion.
>
> Lukas
> _______________________________________________
> Image-SIG maillist - Image-SIG at python.org
> http://mail.python.org/mailman/listinfo/image-sig
>
>
More information about the Image-SIG
mailing list