YOUR ACCOUNT

Login or Register to post new topics or replies
uberzev
not lyftzev

Posts: 1890
Filters: 36
I know white up/left, black down/right, but after that it gets fuzzy.
  Details E-Mail
Quasimondo
Quasimondo

Posts: 147
Filters: 32
I guess that I have a pretty good idea how it works - at least it does exactly what I want it to do. So what I think happens is this (and I will explain this in pixels even though we learned that there are no pixels in FF):

FF loops through all the pixels in the image. At each pixel it looks at the greyscale value of the vertical and horizontal offset map(s). Now comes the important thing: it does not actually offset the pixel of the source map at that position, but it pulls another pixel to that position and the location of that other pixel depends on the greyscale value combination of the maps. And yes, you are right - if the offset map is <128 grey the pixels will be pulled from left/top, if it's >128 they will be pulled from right/bottom. A grey of 128 will cause no offset at all.

The formula is probably like this:

Where currentX/currentY are the inner loop

getPixelFromX = currentX + ( offsetMapHGreyAtCurrentXY / 128 ) * pixelSize * percent / 100;

getPixelFromY = currentY + ( offsetMapVGreyAtCurrentXY / 128 ) * pixelSize * percent / 100;

So for example to flip an image horizontally you use a horizontal gradient that runs from left 255 -> 0 right.

As you maybe noticed the offset component is currently my favorite because it is so powerful and flexible.

  Details E-Mail
byRo
an Englishman in Brazil

Posts: 138
Filters: 8
Quote
Quasimondo wrote:
A grey of 128 will cause no offset at all.

Call me nit-picker if you wish.... smile:D
The base value that does not cause any offset is actually 127.5. smile;). (128 will do a visible nudge.)

Unlike Photoshop, where you only get the choices of 127 and 128 for mid-grey - neither of which is correct smile:(, the FF folks seem to have implemented this fully.

Rô






_________________________________
My favourite question is "Why?".
My second favourite is "Why not?"
  Details E-Mail
Vladimir Golovin
Administrator
Posts: 3446
Filters: 55
Quote
byRo wrote:
the FF folks seem to have implemented this fully.


Yep -- that's because everything is calculated in floating-point smile;)
  Details E-Mail
Quasimondo
Quasimondo

Posts: 147
Filters: 32
Quote
Vladimir Golovin wrote:
Yep -- that's because everything is calculated in floating-point


So theoretically if it wasn't automatically limited we could work in something like an HDR color space with pixel values < 0 and > 1? I think this might offer a whole range of manipulation methods. Of course it would also offer a whole range of unintended behaviours...
  Details E-Mail
Vladimir Golovin
Administrator
Posts: 3446
Filters: 55
Quote
Quasimondo wrote:
Of course it would also offer a whole range of unintended behaviours...


This is exactly why we dropped the negative values. Plus they were hard to visualize in component previews. However, the possibility of having values greater than 1 ("a partial HDR pipeline" as we call it internally) is still being discussed.
  Details E-Mail
Quasimondo
Quasimondo

Posts: 147
Filters: 32
Quote
Vladimir Golovin wrote:
This is exactly why we dropped the negative values. Plus they were hard to visualize in component previews. However, the possibility of having values greater than 1 ("a partial HDR pipeline" as we call it internally) is still being discussed.


I wouldn't worry too much about how to visulize them: < 0 ==> 0 (black), >1 ==> 1 (white). If someone wants to work with the extended range that person should know what he/she is doing.

I would imagine to have something like a filter specific config tab that allows me to set certain calculation presets for each effect that I create:

- checkbox: use seamless functions
- checkbox: allow pixel values >1
- checkbox: allow pixel values <0
[...]
  Details E-Mail

Join Our Community!

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

33,712 Registered Users
+19 new in 30 days!

153,534 Posts
+27 new in 30 days!

15,348 Topics
+72 new in year!

Create an Account

Online Users Last minute:

5 unregistered users.