On Wed, Feb 08, 2012 at 02:31:37PM -0500, Nelson Tong wrote: > Thanks Randolph. > > this solution does indeed work for me. The mapping function just > manages to manipulate the pixel values enough so that png image can be > opened and be pasted onto other images without become blank. > > lambda i:i * .0039062500 + 0 > > how important is the use of the generalized mapping function in here? > does the scale and offset of function definitely needs to be adjusted > if every image I want to process is similar to each other in terms of > min and max values? > > On 2/4/12, Randolph Bentson <bent...@holmsjoen.com> 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. -- Randolph Bentson bent...@holmsjoen.com _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig