[PYTHON IMAGE-SIG] The Image.new() function doesn't initialize the new image

Fred L. Drake fdrake@CNRI.Reston.Va.US
Fri, 17 Jan 1997 08:43:38 -0500 (EST)


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@cnri.reston.va.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@python.org
administrivia to: image-sig-request@python.org
_______________