Hi I have problems with tif files

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Hi I have problems with tif files

gujax
Image.open('filename') and im.info gives the following

(640, 480)
{'resolution': (1, 1), 'compression': 'raw'}
F;32BF
TIFF


But when I run the im.show() it gives the following error.
>>> im.show()
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    im.show()
  File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 1483, in
show
    _show(self, title=title, command=command)
  File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 2123, in
_show
    apply(_showxv, (image,), options)
  File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 2127, in
_showxv
    apply(ImageShow.show, (image, title), options)
  File "/usr/lib/python2.6/dist-packages/PIL/ImageShow.py", line 41, in
show
    if viewer.show(image, title=title, **options):
  File "/usr/lib/python2.6/dist-packages/PIL/ImageShow.py", line 62, in
show
    base = Image.getmodebase(image.mode)
  File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 245, in
getmodebase
    return ImageMode.getmode(mode).basemode
  File "/usr/lib/python2.6/dist-packages/PIL/ImageMode.py", line 50, in
getmode
    return _modes[mode]
KeyError: 'F;32BF'

I have no idea why this happens.
I will appreciate your response. The file opens with ImageJ and
ImageMagick. It is a 8-bit RGB file.
I have looked up Google and came across few similar queries but do not
find any resolution other than suggestions to link xv to ImageMagick.
Because the solutions are old i.e., dated in 2007, I am not sure if this
is a fix. Please help.
Thanks,
Rajan



_______________________________________________
Image-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/image-sig

092010_triangle_2.tif (1M) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Hi I have problems with tif files

Edward Cannon
what os and verson are you using. show is pretty much for debugging
only, and is pretty sketchy on windows. also try looking at im.mode,
is it RGB or something else?
Edward Cannon

On Tue, Sep 21, 2010 at 10:24 PM, Rajan Gurjar <[hidden email]> wrote:

> Image.open('filename') and im.info gives the following
>
> (640, 480)
> {'resolution': (1, 1), 'compression': 'raw'}
> F;32BF
> TIFF
>
>
> But when I run the im.show() it gives the following error.
>>>> im.show()
> Traceback (most recent call last):
>  File "<pyshell#0>", line 1, in <module>
>    im.show()
>  File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 1483, in
> show
>    _show(self, title=title, command=command)
>  File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 2123, in
> _show
>    apply(_showxv, (image,), options)
>  File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 2127, in
> _showxv
>    apply(ImageShow.show, (image, title), options)
>  File "/usr/lib/python2.6/dist-packages/PIL/ImageShow.py", line 41, in
> show
>    if viewer.show(image, title=title, **options):
>  File "/usr/lib/python2.6/dist-packages/PIL/ImageShow.py", line 62, in
> show
>    base = Image.getmodebase(image.mode)
>  File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 245, in
> getmodebase
>    return ImageMode.getmode(mode).basemode
>  File "/usr/lib/python2.6/dist-packages/PIL/ImageMode.py", line 50, in
> getmode
>    return _modes[mode]
> KeyError: 'F;32BF'
>
> I have no idea why this happens.
> I will appreciate your response. The file opens with ImageJ and
> ImageMagick. It is a 8-bit RGB file.
> I have looked up Google and came across few similar queries but do not
> find any resolution other than suggestions to link xv to ImageMagick.
> Because the solutions are old i.e., dated in 2007, I am not sure if this
> is a fix. Please help.
> Thanks,
> Rajan
>
>
>
> _______________________________________________
> Image-SIG maillist  -  [hidden email]
> http://mail.python.org/mailman/listinfo/image-sig
>
>
_______________________________________________
Image-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/image-sig
Reply | Threaded
Open this post in threaded view
|

Re: Hi I have problems with tif files

gujax
I am using Lucid - Ubuntu on an FX- Sony laptop which is ten years old but works excellent. The pictures I have tried are both RGB and grayscale tif images. Some of them do open up but not others and I am not sure what type of tifs open and why do the other tifs do not. I will try im.mode.
I have listed the tiffinfo properties of one type of tif that I could not open in the postings.
Thanks,
gujax

On Fri, Oct 1, 2010 at 12:45 PM, Edward Cannon <[hidden email]> wrote:
what os and verson are you using. show is pretty much for debugging
only, and is pretty sketchy on windows. also try looking at im.mode,
is it RGB or something else?
Edward Cannon

On Tue, Sep 21, 2010 at 10:24 PM, Rajan Gurjar <[hidden email]> wrote:
> Image.open('filename') and im.info gives the following
>
> (640, 480)
> {'resolution': (1, 1), 'compression': 'raw'}
> F;32BF
> TIFF
>
>
> But when I run the im.show() it gives the following error.
>>>> im.show()
> Traceback (most recent call last):
>  File "<pyshell#0>", line 1, in <module>
>    im.show()
>  File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 1483, in
> show
>    _show(self, title=title, command=command)
>  File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 2123, in
> _show
>    apply(_showxv, (image,), options)
>  File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 2127, in
> _showxv
>    apply(ImageShow.show, (image, title), options)
>  File "/usr/lib/python2.6/dist-packages/PIL/ImageShow.py", line 41, in
> show
>    if viewer.show(image, title=title, **options):
>  File "/usr/lib/python2.6/dist-packages/PIL/ImageShow.py", line 62, in
> show
>    base = Image.getmodebase(image.mode)
>  File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 245, in
> getmodebase
>    return ImageMode.getmode(mode).basemode
>  File "/usr/lib/python2.6/dist-packages/PIL/ImageMode.py", line 50, in
> getmode
>    return _modes[mode]
> KeyError: 'F;32BF'
>
> I have no idea why this happens.
> I will appreciate your response. The file opens with ImageJ and
> ImageMagick. It is a 8-bit RGB file.
> I have looked up Google and came across few similar queries but do not
> find any resolution other than suggestions to link xv to ImageMagick.
> Because the solutions are old i.e., dated in 2007, I am not sure if this
> is a fix. Please help.
> Thanks,
> Rajan
>
>
>
> _______________________________________________
> Image-SIG maillist  -  [hidden email]
> http://mail.python.org/mailman/listinfo/image-sig
>
>


_______________________________________________
Image-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/image-sig
Reply | Threaded
Open this post in threaded view
|

Re: Hi I have problems with tif files

Fredrik Lundh
In reply to this post by gujax
On Wed, Sep 22, 2010 at 7:24 AM, Rajan Gurjar <[hidden email]> wrote:
> Image.open('filename') and im.info gives the following
>
> (640, 480)
> {'resolution': (1, 1), 'compression': 'raw'}
> F;32BF

Where did the "F;32BF" come from?

> TIFF
>
>
> But when I run the im.show() it gives the following error.
>>>> im.show()
> Traceback (most recent call last):
>  File "<pyshell#0>", line 1, in <module>
>    im.show()
>  File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 1483, in
> show
>    _show(self, title=title, command=command)
>  File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 2123, in
> _show
>    apply(_showxv, (image,), options)
>  File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 2127, in
> _showxv
>    apply(ImageShow.show, (image, title), options)
>  File "/usr/lib/python2.6/dist-packages/PIL/ImageShow.py", line 41, in
> show
>    if viewer.show(image, title=title, **options):
>  File "/usr/lib/python2.6/dist-packages/PIL/ImageShow.py", line 62, in
> show
>    base = Image.getmodebase(image.mode)
>  File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 245, in
> getmodebase
>    return ImageMode.getmode(mode).basemode
>  File "/usr/lib/python2.6/dist-packages/PIL/ImageMode.py", line 50, in
> getmode
>    return _modes[mode]
> KeyError: 'F;32BF'
>
> I have no idea why this happens.
> I will appreciate your response. The file opens with ImageJ and
> ImageMagick. It is a 8-bit RGB file.

Are you sure it's 8-bit?  (F;32BF indicates otherwise)

What's the mode attribute set to for this image?  What happens if you
convert to grayscale (mode L) before displaying it?

</F>
_______________________________________________
Image-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/image-sig