[PYTHON IMAGE-SIG] PIL example scripts?

Fredrik Lundh fredrik_lundh@ivab.se
Thu, 6 Mar 1997 13:35:32 +0100


> I want to compare two images by computing something like an RMS
> value for the difference of the images.  Is this easily doable with
> PIL (and possibly NumPy mixed in)?

Lets see...

	h1 = Image.open("image1").histogram()
	h2 = Image.open("image2").histogram()

	rms = math.sqrt(reduce(operator.add,
		map(lambda a,b: (a-b)**2, h1, h2))/len(h1))
	
Or something (completely untested).

> In general, are there some interesting PIL example scripts laying
> about?  I didn't see much in the PIL distribution and nothing in the
> contrib section of the Python site.

Except for the Scripts subdirectory (which IMO contains some pretty
interesting stuff), its not much.  Will probably put some material
that doesn't fit into the book at my homepage, but its not much there
yet.

Cheers	/F (http://hem1.passagen.se/eff)

_______________
IMAGE-SIG - SIG on Image Processing with Python

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