Re: open, show, png, blank
Nelson Tong <[email protected]> Thu, 9 Feb 2012 12:16:08 -0500
| Newsgroups | gmane.comp.python.image |
|---|---|
| Message-ID | <CAK+C3jd2rfwHqU=7hXL1xpWP1CxR5gSY2PfaaxZoRyWSkgdAxA@mail.gmail.com> |
>> >> On 2/4/12, Randolph Bentson <[email protected]> wrote: >> > Oh, I guess the lambda function should be generalized by >> > >> > (lo,hi) = outI.getextrema() >> > x = 256.0/(hi-lo) >> > y = (0-lo)/256.0 >> > outJ = outI.point(lambda i:i*x+y) > > I have no experience with these type images, so I don't know if > constant values are appropriate. The performance of the generalized > mapping seems quick enough, so that may be safer. BUT, there's > one questionable issue with this function: it turns the darkest > source pixel to black and the lightest pixel to white. I hope > others can provide some comments on that. I'm not an expert in image processing. I just want to learn more about this since we are talking about the mapping function here. I don't quite completely understand how this generalized mapping function work with im.point(). Given the hi and lo from getextema(), I understand that x = 256.0/(hi-lo) is a way to to adjust the scale parameter to the have a range of values from 0 to 256. but where does the offset of (y= (0-lo) /256 ) comes from ? is there any reference anyone can recommend as a tutorial about this kind of mapping function? > > -- > Randolph Bentson > [email protected] > _______________________________________________ Image-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/image-sig