I am using PIL for image processing in ubuntu 9.04. When i give two
im.show() commands for two different images, the second image is not
displayed (eye of gnome is the display program). It says no such file
or directory. Any ideas?
thanks
suresh
Thanks
Sean
I used to get no such file or directory showing some files in /tmp
directory. But today I am getting a different type of message, which
appeared yesterday also.
(eog:8368): Gtk-CRITICAL **: gtk_tree_model_get_iter: assertion `path-
>depth > 0' failed
(eog:8368): Gtk-CRITICAL **: gtk_list_store_get_value: assertion
`VALID_ITER (iter, list_store)' failed
(eog:8368): GLib-GObject-WARNING **: /build/buildd/glib2.0-2.20.1/
gobject/gtype.c:3940: type id `0' is invalid
(eog:8368): GLib-GObject-WARNING **: can't peek value table for type
`<invalid>' which is not currently referenced
Segmentation fault
-----------code----------------------
#!/usr/bin/python
print "Aum Amriteshwaryai Namaha"
import Image
imagePath = "/home/suresh/EE241/book_images_3ed/ch03/"
im34 = Image.open(imagePath + "breast_digital_Xray.tif")
im35 = Image.open(imagePath + "DFT_no_log.tif")
im35.show()
def neg(x):
return 255-1-x
import math
def logtr(x):
y = math.log(1+x,10)
print y
return y*100
im34x = im34.point(neg)
im34x.show()
im35x = im35.point(logtr)
im35x.show()
---------------------------------------end of code
Any ideas?
Thanks
suresh
Suresh ....
I also had problems with show() when using eye of gnome
as the image viewer with your code but no problems using
the display viewer from the imagemagick package ....
im.show( command = 'eog' ) # problems
im.show( command = 'display' ) # no problems
# ----------------------------------------------------------
#!/usr/bin/python
'''
NewsGroup .... comp.lang.python
Subject ...... PIL show() not working for 2nd pic
Date ......... 2010-01-07
Post_By ...... suresh.amritapuri
Edit_By ...... Stanley C. Kitching
'''
import math
import Image
list_source = [
'image/beach.tif' ,
'image/colors.tif' ]
list_target = [ ]
def neg( x ) :
return 255 - 1 - x
def logtr( x ) :
y = math.log( 1 + x , 10 )
print y
return y * 100
for this_image in list_source :
im_source = Image.open( this_image )
im_neg = im_source.point( neg )
im_logtr = im_source.point( logtr )
list_target.append( im_source )
list_target.append( im_neg )
list_target.append( im_logtr )
for this_image in list_target :
this_image.show( command = 'display' )
# ----------------------------------------------------------
--
Stanley C. Kitching
Human Being
Phoenix, Arizona