You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Original issue reported on code.google.com by eric.p...@gmail.com on 9 Oct 2012 at 9:03
The text was updated successfully, but these errors were encountered:
Please find here a patch (against the current svn HEAD) to fix this issue. It
enhances the behaviour of TIFF.write_image() when write_rgb=True.
Basically, when this flag is True, write_image() will always write a single
image, and try its best to describe it as a RGB (or RGBA) image.
Note that it also modifies the orientation tag to the correct value, which
fixes issue 18.
The patch is available also as a git commit here:
https://github.com/delmic/pylibtiff/commit/cc38e51ae0857b605c81e7f631279b5cd54de
55d
Original comment by eric.p...@gmail.com on 5 Aug 2013 at 2:08
Original issue reported on code.google.com by
eric.p...@gmail.com
on 9 Oct 2012 at 9:03The text was updated successfully, but these errors were encountered: