[Image-SIG] Array to image problem.

Yury V. Zaytsev yury at shurup.com
Sat Jun 5 21:19:09 CEST 2010


I will not reply to any further messages you send me off the list!

On Sat, 2010-06-05 at 21:40 +0300, Валери Милев wrote:

> with .convert("L") and array=asarray(i) works! Thaks for the Tip!! 
> That is very strange because the values are the same like im my
> method. The only difreance I noticed is that the data type is "uint8".
> Any way, my array is a result of sustraction from images and now with
> "uint8" when one pixel has a value 15 - 20=250. Insead of black I have
> white. Do you know how can a overcome this issue?

I don't know what you are doing and what you want to achieve. 

In grayscale mode the colors have to be in the range from 0 to 255 and
it's your responsibility to assure this is the case before you convert
your matrix to the image. You can do your matrix operations on matrices
of higher bitness and re-normalize them before you convert to uint8
using NumPy to feed into PIL.

Sincerely yours,
Yury V. Zaytsev

More information about the Image-SIG mailing list