ThreeDee
![]() |
Here's a nice little trick for ya.
It is sometimes a bit difficult to figure out how to offset something in the way you want. What if you could just map the image with x and y coordinates? With a fast Offset trick, you can. The idea is: Black is 0, white is 100 in both x and y coordinates. Feed two images that contain the coordinate information into two inputs and, voila, you have distorted the original image exactly to those coordinates. Take an easy example at first: You plug in a horizontal profile gradient black to white to x coordinates and a vertical profile gradient black to white to y coordinates, you get a copy of the original image. Then you flip one of the gradients, you get a mirror image along one of the axis. Or you switch the horizontal and vertical gradients and you get a rotated image. Or you increase the Repeat amount of either and you get multiple copies. Then you can get more fancy and plug in a curve to the Gradient Profile input and distort the image. Or you plug in a radial gradient into one input and a circular into the other one, and you get polar coordinates transformation. And it goes from there. The whole idea is that it is easier to visualize the final outcome if you always have black = 0, white = 100 for the x and y coordinates. And you can do distortions that you might have thought were impossible or very complex. Sample snippet with sine curves below. Get X, Y.ffxml |
|
Posted: April 9, 2009 3:28 am | ||
ThreeDee
![]() |
A fancier example of what can be done with some gradient blending combined with this.
![]() |
|
Posted: April 10, 2009 3:46 am | ||
ThreeDee
![]() |
Here are the GetX and GetY maps for the above image:
![]() ![]() |
|
Posted: April 10, 2009 4:00 am | ||
CorvusCroax
![]() |
Hi ThreeDee
So, I think I follow this; instead of using the offset to indicate the change to the image, you're using gradients as absolutes in the X and Y? (that's awesome!) Could you explain how the snippet works? I messed around w/ it last night - and realized how little I understand... ![]() |
|
Posted: April 10, 2009 12:26 pm | ||
ThreeDee
![]() |
Hi Corvus,
Yes, you've got the idea. It makes using Offset much more painless when you can use coordinates from the original image and know that black is always x=0 (or y=0) and white is always x=100 (or y=100), no matter where in the image that value appears. While you don't need to understand how it works to make it work, it is always nice to understand it. So: To get the idea of how the two offsets work, you could ask yourself "which X-offset will give me the x=0 point from the original image wherever my image is full black?" If you start with an image that is black everywhere, the answer is "a gradient that is mid-gray at left edge and white in the right edge." (You can try this) Similarly, the X-offset that gives you the x=100 point from the original image is a gradient that is black at the left edge and mid-gray at the right edge. If you follow so far, you can see that, simply enough, everything else is a blend between these two. Thus the offset images ("Get X" and "Get Y") are used as the opacity control to blend between these two gradients. Same with the Y-offset, just vertically. It is really easy to pre-visualize the final result of your offsets this way. Trying to do figure it out without this trick is a real pain in the butt. I'll do some more simple visual examples to show how this works a bit later. TD |
|
Posted: April 10, 2009 1:36 pm | ||
CorvusCroax
![]() |
Ok, I had to read that two times to get it... but that's genius!
![]() This is a really powerful technique: It's like you're UV mapping using the original image - rather than trying to create some prism-thing which points to the right location. >It is really easy to pre-visualize the final result of your offsets this way. >Trying to do figure it out without this trick is a real pain in the butt. I'll say! One could so some interesting things using more structured inputs... like a very simple way to scatter things. Hey, you could make a really simple sphereify filter like this. (I think) I can't wait to give it another whirl! |
|
Posted: April 10, 2009 4:46 pm | ||
CorvusCroax
![]() |
||
Posted: April 11, 2009 12:50 am | ||
CorvusCroax
![]() |
||
Posted: April 11, 2009 12:52 am | ||
CorvusCroax
![]() |
||
Posted: April 11, 2009 12:52 am | ||
CorvusCroax
![]() |
||
Posted: April 11, 2009 12:53 am | ||
CorvusCroax
![]() |
||
Posted: April 11, 2009 1:28 am | ||
CorvusCroax
![]() |
||
Posted: April 11, 2009 1:30 am | ||
CorvusCroax
![]() |
||
Posted: April 11, 2009 2:19 am | ||
CorvusCroax
![]() |
||
Posted: April 11, 2009 2:20 am | ||
CorvusCroax
![]() |
||
Posted: April 11, 2009 2:23 am | ||
CorvusCroax
![]() |
||
Posted: April 11, 2009 2:27 am | ||
Crapadilla
![]() |
So you're still planning to write that definitive wiki article on offsets, ThreeDee?
![]() ![]() --- Crapadilla says: "Damn you, stupid redundant feature requests!" ;) |
|
Posted: April 18, 2009 4:28 am |
Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!
33,714 Registered Users
+20 new in 30 days!
153,537 Posts
+6 new in 7 days!
15,348 Topics
+72 new in year!
24 unregistered users.