Re: [PYTHON IMAGE-SIG] The Image.new() function doesn't initialize the new image
by Fred L. Drake other posts by this author
Jan 17 1997 11:43AM messages near this date
Re: [PYTHON IMAGE-SIG] The Image.new() function doesn't initialize the new image
|
Re: [PYTHON IMAGE-SIG] The Image.new() function doesn't initialize the new image
Fredrik Lundh wrote:
> Now, the only problem is whether I should change the documentation or
> the implementation. Opinions?
I have slightly mixed feelings on this one. I like the idea of it
being initialized to something known, but a new implementation of
Image.new() can be provided by applications that want that interface.
The current implementation has a performance advantage which is
probably small most of the time, but hard to regain once lost. I'd
revise the documentation for this one, and interested applications
could do something like:
import Image
def newImage(mode, size, color=None):
if color is None:
color = DEFAULT_COLORS[mode]
return Image.new(mode, size, color)
-Fred
--
Fred L. Drake, Jr.
fdrake@[...].us
Corporation for National Research Initiatives
1895 Preston White Drive
Reston, VA 20191-5434
_______________
IMAGE-SIG - SIG on Image Processing with Python
send messages to: image-sig@[...].org
administrivia to: image-sig-request@[...].org
_______________
Thread:
Fredrik Lundh
Guido van Rossum
Fred L. Drake
Fredrik Lundh
|