Smear Now - Or Smear Later

| No Comments | No TrackBacks

postSmear0.jpg
If you work with pixel addresses instead of the pixels themselves, you can smear (or ray trace) now, and decide which image it was you were smearing (or refracting) later.

allGrads.jpg
Take a linear horizontal red grad and add it to a linear vertical green grad. This will give you an image of absolute pixel addresses - or what some might call an image of UV values.

annotatedUVs.jpg
In such an image, you can calculate any pixel's position if you know its color, and you can determine its color if you know its position. That's what makes it an image of absolute pixel addresses.

example1.jpg
Grab a hunk of these absolute pixel address from anywhere you like and move them to any other place on the image that you like.

difference.jpg
Next subtract the modified image of absolute pixel addresses from the original image of absolute pixel addresses. This will give you an image of relative pixel displacement offsets.

example1b.jpg
Here are the relative pixel offsets. Notice that any chunk of addresses that was moved horizontally became a shade of red with an intensity proportional to the distance it was moved. Any chunk of addresses that was moved vertically is green. Those that were move diagonally are yellow.

horizSmear.jpg
You can move the pixel addresses using any technique you like. Put a refractive object in front of the original UV image and raytrace into it. Or smear it using a Photoshop tool, if you like, which is what I did in the example above.

horizSmearDiff.jpg
After you subtract the smeared UV image from the original UV image, you'll end up with a displacement map of pure relative smears.

vertSmear.jpg
Here's another example.

vertSmearDiff.jpg
After the subtraction, it looks as above.

postSmear1.jpg
Using this technique, you can smear in "address space" and then later apply the smears (or refractions or what have you) to an image after the fact.

postSmear2.jpg
What's more, you can change your mind later, and swap one image for another.

One last thing: there are some issues with using the difference blend mode in Photoshop. That blend mode returns absolute values, even in cases when a true subtraction would return negative numbers. There are some issues with Photoshop displacement as well. Instead of using negative numbers, zero, and positive numbers to control displacement, Photoshop uses dark colors, middle gray, and bright colors to control it.

If you want to explore this yourself, you might be better off using Shake, which can handle the negative numbers during internal calculations in a way that Photoshop can't. To see the Shake version in action, check out UV Map Now or UV Map Later.

If you want a better idea of the "gotchas" in Photoshop displacement, the gory details are here

UPDATE 5/10/2009

In Distort Photoshop Filter Without Distorting Image I clued in to the idea of using channel calculations to compute the correct vectors.

No TrackBacks

TrackBack URL: http://www.digitalartform.com/cgi-bin/mt/mt-tb.cgi/14

Leave a comment

About this Entry

This page contains a single entry by published on October 20, 2004 8:27 AM.

Digital Heat Ripple was the previous entry in this blog.

Locas: Jaime Hernandez Art Book is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.