Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 21 by
eric.p...@gmail.com: RGB image format doesn't follow the
standard numpy RGB format
http://code.google.com/p/pylibtiff/issues/detail?id=21
write_image() supports RGB image if write_rgb=True is passed, but it
expects an numpy array in the format 3xMxN for an image of MxN pixels,
while the normal RGB images in numpy are encoded MxNx3.
For reference, see the documentation here:
http://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.imread.html
As a workaround, I currently send a view of my array with axes swapped to
write_image. Like this:
image = scipy.ndimage.imread("test.jpg")
image_sw = image.swapaxes(2,0).swapaxes(2,1)
tif.write_image(image_sw, write_rgb=True)
I can try to provide a patch if you're interested.