12 bits tif image issue with skimage 0.5dev
Dear all, I update skimage to 0.5 dev on my ubuntu box. ipython startup gives: Imported NumPy 1.3.0, SciPy 0.7.2, Matplotlib 0.99.3 + guidata 1.2.5, guiqwt 2.0.8.1 Type "scientific" for more details.
import skimage skimage.version <module 'skimage.version' from '/usr/local/lib/python2.6/dist-packages/scikits_image-0.5dev-py2.6-linux-i686.egg/skimage/version.pyc'>
A 12 bits tif image when loaded with skimage do not behave like the same image loaded with an other library (readmagick, mahotas), as shown above. When a 8 bits png image is loaded, the differences (orientation, saturation) vanish. In a previous message Neil Yager said that the issue was fixed<https://groups.google.com/forum/#%21topic/scikits-image/JSvqMzOgTEE>. What should I do to fix the problem on my machine? Thank you. Jean-Patrick
On 12/9/2011 2:47 AM, jip wrote:
Dear all, I update skimage to 0.5 dev on my ubuntu box. ipython startup gives: Imported NumPy 1.3.0, SciPy 0.7.2, Matplotlib 0.99.3 + guidata 1.2.5, guiqwt 2.0.8.1 Type "scientific" for more details.
import skimage skimage.version <module 'skimage.version' from '/usr/local/lib/python2.6/dist-packages/scikits_image-0.5dev-py2.6-linux-i686.egg/skimage/version.pyc'>
A 12 bits tif image when loaded with skimage do not behave like the same image loaded with an other library (readmagick, mahotas), as shown above. When a 8 bits png image is loaded, the differences (orientation, saturation) vanish.
In a previous message Neil Yager said thatthe issue was fixed <https://groups.google.com/forum/#%21topic/scikits-image/JSvqMzOgTEE>. What should I do to fix the problem on my machine? Thank you.
Jean-Patrick
Hi, the PIL plugin has been fixed to correctly read 16 bit images. A PR for imshow is pending. The matplotlib plugin, which internally also uses PIL, is still broken. Matplotlib returns 8 bit, flipped images (by design it seems). The problem is that PIL does not handle 16 bit images well. The solution in this case is to use more capable plugins for reading (e.g. FreeImage) and show (matplotlib ): skimage.io.use_plugin('matplotlib', 'imshow') skimage.io.use_plugin('freeimage', 'imread') Christoph
Hi, Thank you for your explanations. Jean-Patrick On 9 déc, 17:12, Christoph Gohlke <cjgoh...@gmail.com> wrote:
On 12/9/2011 2:47 AM, jip wrote:
Dear all, I update skimage to 0.5 dev on my ubuntu box. ipython startup gives: Imported NumPy 1.3.0, SciPy 0.7.2, Matplotlib 0.99.3 + guidata 1.2.5, guiqwt 2.0.8.1 Type "scientific" for more details.
import skimage skimage.version <module 'skimage.version' from '/usr/local/lib/python2.6/dist-packages/scikits_image-0.5dev-py2.6-linux-i686.egg/skimage/version.pyc'>
A 12 bits tif image when loaded with skimage do not behave like the same image loaded with an other library (readmagick, mahotas), as shown above. When a 8 bits png image is loaded, the differences (orientation, saturation) vanish.
In a previous message Neil Yager said thatthe issue was fixed <https://groups.google.com/forum/#%21topic/scikits-image/JSvqMzOgTEE>. What should I do to fix the problem on my machine? Thank you.
Jean-Patrick
Hi,
the PIL plugin has been fixed to correctly read 16 bit images. A PR for imshow is pending. The matplotlib plugin, which internally also uses PIL, is still broken. Matplotlib returns 8 bit, flipped images (by design it seems).
The problem is that PIL does not handle 16 bit images well. The solution in this case is to use more capable plugins for reading (e.g. FreeImage) and show (matplotlib ):
skimage.io.use_plugin('matplotlib', 'imshow') skimage.io.use_plugin('freeimage', 'imread')
Christoph
participants (2)
-
Christoph Gohlke
-
jip