Re: [matplotlib-devel] Quantization of normalized float to uint8

2011-09-20 Thread Christoph Gohlke
On 9/19/2011 2:23 AM, Christoph Gohlke wrote: > > > On 9/18/2011 2:30 PM, Eric Firing wrote: >> On 09/18/2011 09:30 AM, Christoph Gohlke wrote: >>> Hello, >>> >>> matplotlib uses int(x*255) or np.array(x*255, np.uint8) to quantize >>> normalized floating point numbers x in the range [0.0 to 1.0]

Re: [matplotlib-devel] Quantization of normalized float to uint8

2011-09-19 Thread Christoph Gohlke
On 9/18/2011 2:30 PM, Eric Firing wrote: > On 09/18/2011 09:30 AM, Christoph Gohlke wrote: >> Hello, >> >> matplotlib uses int(x*255) or np.array(x*255, np.uint8) to quantize >> normalized floating point numbers x in the range [0.0 to 1.0] to >> integers in the range [0 to 255]. This way only 1.0

Re: [matplotlib-devel] Quantization of normalized float to uint8

2011-09-18 Thread Eric Firing
On 09/18/2011 09:30 AM, Christoph Gohlke wrote: > Hello, > > matplotlib uses int(x*255) or np.array(x*255, np.uint8) to quantize > normalized floating point numbers x in the range [0.0 to 1.0] to > integers in the range [0 to 255]. This way only 1.0 is mapped to 255, > not for example 0.999. Is thi

[matplotlib-devel] Quantization of normalized float to uint8

2011-09-18 Thread Christoph Gohlke
Hello, matplotlib uses int(x*255) or np.array(x*255, np.uint8) to quantize normalized floating point numbers x in the range [0.0 to 1.0] to integers in the range [0 to 255]. This way only 1.0 is mapped to 255, not for example 0.999. Is this really intended or would not the largest floating poi