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: [Image-SIG] Re: Image.eval problem with math.sqrt
by other posts by this author
Jul 14 2003 11:46AM messages near this date
[Image-SIG] Re: Image.eval problem with math.sqrt | [Image-SIG] Image.eval problem with math.sqrt
On 13 Jul 2003 20:10:17 -0400
"Alan Grosskurth" <alan.grosskurth@[...].ca>  wrote:

>  That works fine for 8-bit images, but I'm
>  still have trouble with mode 'I' images (32-bit integer):
>  
>      image = Image.new('I', (10, 10))
>      out = Image.eval(image, math.sqrt)

This gets beyond my knowledge. That code calls point(), and according to
the docs:

    If the image has mode "I" (integer) or "F" (floating point), you
    must use a function, and it must have the following format: argument
    * scale+ offset 

    Example: Map floating point images 

        out = im.point(lambda i: i * 1.2 + 10) 

    You can leave out either the scale or the offset.

Using the example lambda works in your eval(), but I don't see how to
get in a sqrt(). Perhaps someone with better Python knowledge can help?

-Bill
-- 
Sattre Press                                The King in Yellow
http://sattre-press.com/                 by Robert W. Chambers
info@[...].com             http://kiy.sattre-press.com/ 

_______________________________________________
Image-SIG maillist  -  Image-SIG@[...].org
http://mail.python.org/mailman/listinfo/image-sig
Thread:
Alan Grosskurth


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