YOUR ACCOUNT

Login or Register to post new topics or replies
Tim2501
Posts: 26
Filters: 63
Is it possible to 'undo' a transformation with an image-input for e.g. 'rotation'?

My idea was to distort an image, then apply an effect and then un-distort it to make an directional effect more dynamic.

I found that if an image is used to distort another image, it's impossible to transform that one back to its original state.

Does anyone know something? smile:D
  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20
In theory, since FF is sample based and not pixel based, I think any transformation you do can be undone, it's just a matter of knowing exactly what the transformation was, and doing the exact opposite of it.
  Details E-Mail
ThreeDee
Lost in Space

Posts: 1672
Filters: 112
Not everything is reversible, but many of the simpler transformations -- such as rotation -- are.
  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20
What if you take a perlin noise and apply it as offset for an image, can you then apply the reverse distortion by inverting the noise?

Edit: No... I don't know why, but it just seems to distort it even further. smile:?:
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
It is possible that several samples are fetched from the same location in the first transformation - so how could a "reverse" transformation revert that? The simple case of this is a lookup transformation without "image input".

However the idea has some merit: transform something... process it and reverse the transform... we've used that trick several times with e.g. spherify - blur - unspherify and also other cases (wave blur etc)
  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
  Details E-Mail
Tim2501
Posts: 26
Filters: 63
Well, I've come to the result that it's pretty much impossible to calculate the mask that would "un-transform" an image. Maybe it's possible using scripting though.

Attached are several attempts to un-transform an image using various transformation methods and masks

Reverse transformations.ffxml
  Details E-Mail
ThreeDee
Lost in Space

Posts: 1672
Filters: 112
Yes, it is a bit of an tricky problem for solving procedurally.

When you offset something, the starting point will no longer "know" where it was offset to. You will have to look for the point in all the possible places it could have gone. Which means scripting it.

Here is a simple situation with a horizontally offset image:

I wrote a script that looks at every pixel in that horizontal row to find the one that is closest to the origin point. This point is then used for the Lookup component to reverse the offset.

Now, since you have to search 600 different points to locate a closest match for horizontal offset (for a 600x600 image), you can see that it goes pretty slow. And it isn't all that accurate either, since there is no in-between pixel checking.

Anyways, this approach works and can certainly be improved upon.

Reverse Offset.ffxml
  Details E-Mail
ThreeDee
Lost in Space

Posts: 1672
Filters: 112
I hope there is a way to optimize the procedure, for it does create some interesting results.

Here I motion blurred the image vertically between Offsetting and reversing the Offset. With 5 sample antialiasing, this simple render took more than ten minutes on my faster computer.

  Details E-Mail
ThreeDee
Lost in Space

Posts: 1672
Filters: 112
Purposely using just the Reverse Offset (leaving out the original Offset) to distort the image gives this result. Notice the self-overlapping areas in the image. Only if it didn't take 25 minutes to render this...

  Details E-Mail

Join Our Community!

Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!

33,719 Registered Users
+8 new in 7 days!

153,545 Posts
+5 new last day!

15,348 Topics
+71 new in year!

Create an Account

Online Users Last minute:

37 unregistered users.