[PYTHON IMAGE-SIG] Reading, displaying, and manipulating sun-rasters

Zack Roadhouse zack@lems.brown.edu
Fri, 14 Jun 1996 17:04:30 -0400


My group is trying to load in a raster file to manipulate it as an object
in a canvas.  We are using this hack to convert the ras to a gif for
easy display using convert (part of the ImageMagick 3.7.3
distribution):

	  if self.filename[-3:]=='ras':
	       root_filename=self.filename[:-4]
	       os.system('convert'+' '+self.filename+' '+root_filename+'.gif')
	       self.filename=root_filename+'.gif'
	  
	  self.img=Image.open(self.filename)
	  self.tkim=ImageTk.PhotoImage(self.img.mode,self.img.size)
	  self.tkim.paste(self.img)
	  self.photo=Label(self,image=self.tkim.image)
	  self.photo.pack({'side':'top'})

Unfortunately, when the image shows up it is strangly distorted.
Several duplicates appear in the same frame, although they appear
squished to something like 1/2,1/4,1/8 size.  Four appear.  Have any
ideas for us?

Our problem is that ImageTk won't accept a ras file read in by Image.
Is there another way to do this?  Please reply to everyone.

			--Zack

/---------------------------------------------------------------------
Zachary F. Roadhouse 				   Home: (847)869-5146
Box 220, Brown University, Providence, RI 02912    Work: (401)863-2177
E-MAIL: Zachary_Roadhouse@brown.edu
WWW: http://www.netspace.org/~zack

=================
IMAGE-SIG - SIG on Image Processing with Python

send messages to: image-sig@python.org
administrivia to: image-sig-request@python.org
=================