ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> image-sig
image-sig
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved