Discussion:
How to save black and white images
NewPy
2013-06-13 05:15:59 UTC
Permalink
The following code save the numpy array as red/blue strips, how can I save
an array as grey scale image?

import numpy as np
import mahotas
img = np.ones([10,10])
img[::2,:]=0
mahotas.imsave('test.png', img)


Another example, read an image in as grey scale, imsave produce color
image, how to preserve it as grey scale?
s_file='Nuts.png'
img = mahotas.imread(s_file, as_grey=True)
mahotas.imsave('test.png', img)

Thanks
--
You received this message because you are subscribed to the Google Groups "pythonvision" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pythonvision+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Loading...