views:

282

answers:

4

I'm messing around with image manipulation, mostly using Python. I'm not too worried about performance right now, as I'm just doing this for fun. Thus far, I can load bitmaps, merge them (according to some function), and do some REALLY crude analysis (find the brightest/darkest points, that kind of thing).

I'd like to be able to take an image, generate a set of control points (which I can more or less do now), and then smudge the image, starting at a control point and moving in a particular direction. What I'm not sure of is the process of smudging itself. What's a good algorithm for this?

+1  A: 

One method would be to apply a Gaussian blur (or some other type of blur) to each point in the region defined by your control points.

Adam Rosenfield
That's half of what I'm trying to do. I guess I should have been more specific. I'm trying to "push" an area of an image around, similar to the smudge tool in the GIMP or Photoshop.
Lee Crabtree
+1  A: 

One method would be to create a grid that your control points moves and then use texture mapping techniques to map the image back onto the distorted grid.

rikh
+1  A: 

Try PythonMagick (ImageMagick library bindings for Python). If you can't find it on your distribution's repositories, get it here: http://www.imagemagick.org/download/python/

It has more effect functions than you can shake a stick at.

JCCyC
A: 

I can vouch for a Gaussian Blur mentioned above, it is quite simple to implement and provides a fairly decent blur result.

James