YOUR ACCOUNT

Messages 1 - 45 of 119
First | Prev. | 1 2 3 | Next | Last 
Login or Register to post new topics or replies
uberzev
not lyftzev

Posts: 1890
Filters: 36
** Please download this filter to play along...
http://www.filterforge.com/upload/for...lend.ffxml
**

Say we want to make a very simple zoom-blur type effect using 7 copies of our image.




Easy. But now we want a smoother transition.

That's going to require a bit more work.... smile;)

1st step:
Duplicate existing filter 7 times and plug each result into a final Multiblend.

(no more images from here on, just use your imagination)

2nd step:
Increment scale value on all lower 42 scale components.

3rd step:
Connect top image component to all lower 42 scale components. Delete 6 lower image components.

4th step:
Connect top user zoom control to all lower 42 scale components. Delete 6 bottom user controls.

Now I put this into 4 steps but we're actually talking about something like 150 manual user actions! (And this is a simplified example of the problem.)


****** Now here's a smarter solution that requires zero effort to scale indefinitely... *****

First a 6 image version of the zoom-blur effect...


Easy, now how about 100 images?

(We only had to change 5 values!

So what is going on here?

• uberBlend captures evenly spaced square sections of your image and blends them together.

• The input for uberBlend should be a matrix of smaller images, with each one showing only a small change from the other.

• The Iterations control determines how many square samples to take. Taking only from the top row, it samples from left to right.

• Mode control has similar options as regular Blend component, with the addition of an "Equal" mode which automagically blends all inputs equally.


I believe this can be executed with a script. Someone please try!

Still I think this is too awesome not to be made into an official component...

Thoughts?


==================================================================

Filter that precipitated this idea...


Curve Complexity.ffxml
  Details E-Mail
Carl
c r v a

Posts: 7289
Filters: 82
apart from the zoom blur example what other effects do you see as use for it, the "curve complexity" would still need offsets or would you use some other trick?
  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
Quote
apart from the zoom blur example what other effects do you see as use for it


http://www.filterforge.com/filters/10615.html
http://www.filterforge.com/filters/10612.html
http://www.filterforge.com/filters/10608.html
http://www.filterforge.com/filters/10590.html
http://www.filterforge.com/filters/10478.html

Twisting, morphing, blurring type filters.
Also bomber effects are possible.
  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
I've made a filter which contains a (shoddy) Lua script that demonstrates some of the uberBlend functionality, and operates on my "Curve Complexity" effect.

Try 2,4,6,8 as "Sample" integers. (4 is a bit buggy though)

uberBlend Test.ffxml
  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
Identical script, this time demonstrating bomber ability...

(Yeah my programming sucks. Please fix if you can figure out what I'm trying to do.)

uberBlend Test2.ffxml
  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
Incidentally I've made a change to my spec. Previously I wrote that uberBlend would grab a small sections of your input and then combine them. This added too much complexity to the script.

Now instead it takes full sized sections and combines them. (Samples 2-100 start 'hiddden' to the right)
  Details E-Mail
Skybase
2D/3D Generalist

Posts: 4025
Filters: 76
This is quite lovely. One of the little things I've always wanted in filterforge is some form of iterative / recursive structure so we can produce further complex results without having to produce huge trees of nodes. smile;) Very cool!
  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20
As you can see under my avatar, I can't script.... But bear with me for a sec smile:)

I kinda understand what you're doing in the script, but what are Mode and Samples supposed to be? As far as I can see they're not implemented, so I suppose that they stand for blend mode and itterations\steps to take from the image?

Oh, and instead of g7, g8, b7 and b8 you have r7 and r8. Not that it matters smile:D
  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
Quote
As you can see under my avatar, I can't script.... But bear with me for a sec
Same here! I did the thousand monkey typing shakespear thing and it sort of worked... smile:D

Quote
I kinda understand what you're doing in the script, but what are Mode and Samples supposed to be? As far as I can see they're not implemented, so I suppose that they stand for blend mode and itterations\steps to take from the image?
Correct (not sure if I should call it samples or iterations)

Quote
Oh, and instead of g7, g8, b7 and b8 you have r7 and r8. Not that it matters
Yeah I messed that up, good eye! smile:eek:

Fixed code...

Code

function prepare()

end;

function get_sample(x, y)


   r1, g1, b1 = get_sample_map(x,     y, SOURCE)
   r2, g2, b2 = get_sample_map(x + 1, y, SOURCE)
   r3, g3, b3 = get_sample_map(x + 2, y, SOURCE)
   r4, g4, b4 = get_sample_map(x + 3, y, SOURCE)
   r5, g5, b5 = get_sample_map(x + 4, y, SOURCE)
   r6, g6, b6 = get_sample_map(x + 5, y, SOURCE)
   r7, g7, b7 = get_sample_map(x + 6, y, SOURCE)
   r8, g8, b8 = get_sample_map(x + 7, y, SOURCE)

   r = r1 + r2 + r3 + r4 + r5 + r6 + r7 + r8
   g = g1 + g2 + g3 + g4 + g5 + g6 + g7 + g8
   b = b1 + b2 + b3 + b4 + b5 + b6 + b7 + b8

   return r, g, b

end;
  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20
When I tried to manualy add more samples to the bomber it worked fine. Just had to change the repeat H and V on the Checkers node and double that value in the Scale nodes.

I just tried to hook the Samples to an IntSlider and tried to get it to add more circles.
Well, it worked... Sorta. The more samples you have the more... Squares? you get in the bomber smile:?:

In the image you can see, from left to right, 1 smaple, 2 samples, 4 samples.

  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
Morgantao, right now the only way to add more samples is to hardcode it...

Try this connected to the original source...

Code

function prepare()

end;

function get_sample(x, y)


   r1, g1, b1 = get_sample_map(x,     y, SOURCE)
   r2, g2, b2 = get_sample_map(x + 1, y, SOURCE)
   r3, g3, b3 = get_sample_map(x + 2, y, SOURCE)
   r4, g4, b4 = get_sample_map(x + 3, y, SOURCE)
   r5, g5, b5 = get_sample_map(x + 4, y, SOURCE)
   r6, g6, b6 = get_sample_map(x + 5, y, SOURCE)
   r7, g7, b7 = get_sample_map(x + 6, y, SOURCE)
   r8, g8, b8 = get_sample_map(x + 7, y, SOURCE)
   r9, g9, b9 = get_sample_map(x + 4, y, SOURCE)
   r10, g10, b10 = get_sample_map(x + 5, y, SOURCE)
   r11, g11, b11 = get_sample_map(x + 6, y, SOURCE)
   r12, g12, b12 = get_sample_map(x + 7, y, SOURCE)

   r = r1 + r2 + r3 + r4 + r5 + r6 + r7 + r8 + r9 + r10 + r11 + r12
   g = g1 + g2 + g3 + g4 + g5 + g6 + g7 + g8 + g9 + g10 + g11 + g12
   b = b1 + b2 + b3 + b4 + b5 + b6 + b7 + b8 + b9 + b10 + b11 + b12

   return r, g, b

end;
  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20
Quote
When I tried to manualy add more samples to the bomber it worked fine

Yep, that's what I ment.
Only I don't see why the loop I wrote in the script made it lose the circle shape...
Probably because I can't script smile:D

Oh, maybe I should have mentioned something about changing the script smile:deer:
  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
Here's our 12 sample bomber...



Note that FF's Bomber component maxes at 25. uberBlend laughs at this limitation. smile:D
  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20
In your 12 samples code you need to change the new lines from
Code
   r9, g9, b9 = get_sample_map(x + 4, y, SOURCE)
   r10, g10, b10 = get_sample_map(x + 5, y, SOURCE)
   r11, g11, b11 = get_sample_map(x + 6, y, SOURCE)
   r12, g12, b12 = get_sample_map(x + 7, y, SOURCE)

To:
Code
   r9, g9, b9 = get_sample_map(x + 8, y, SOURCE)
   r10, g10, b10 = get_sample_map(x + 9, y, SOURCE)
   r11, g11, b11 = get_sample_map(x + 10, y, SOURCE)
   r12, g12, b12 = get_sample_map(x + 11, y, SOURCE)
  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
oops, cut & paste fails me once again!

This is why I need some kind of loop or function that lets you choose how many samples you want...

Code
function prepare()

end;

function get_sample(x, y)


   r1, g1, b1 = get_sample_map(x,     y, SOURCE)
   r2, g2, b2 = get_sample_map(x + 1, y, SOURCE)
   r3, g3, b3 = get_sample_map(x + 2, y, SOURCE)
   r4, g4, b4 = get_sample_map(x + 3, y, SOURCE)
   r5, g5, b5 = get_sample_map(x + 4, y, SOURCE)
   r6, g6, b6 = get_sample_map(x + 5, y, SOURCE)
   r7, g7, b7 = get_sample_map(x + 6, y, SOURCE)
   r8, g8, b8 = get_sample_map(x + 7, y, SOURCE)
   r9, g9, b9 = get_sample_map(x + 8, y, SOURCE)
   r10, g10, b10 = get_sample_map(x + 9, y, SOURCE)
   r11, g11, b11 = get_sample_map(x + 10, y, SOURCE)
   r12, g12, b12 = get_sample_map(x + 11, y, SOURCE)

   r = r1 + r2 + r3 + r4 + r5 + r6 + r7 + r8 + r9 + r10 + r11 + r12
   g = g1 + g2 + g3 + g4 + g5 + g6 + g7 + g8 + g9 + g10 + g11 + g12
   b = b1 + b2 + b3 + b4 + b5 + b6 + b7 + b8 + b9 + b10 + b11 + b12

   return r, g, b

end;
  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20
Here's my loop... Maybe you can make it work:
Code
function prepare()
i = get_intslider_input(SAMPLES)
rr=0
gg=0
bb=0
end;

function get_sample(x, y)

while (i >= 1) do
   r1, g1, b1 = get_sample_map(x+i,     y, SOURCE)
   rr = rr + r1
   gg = gg + g1
   bb = bb + b1
   i = i - 1
end;
   r= rr
   g=gg
   b=bb
   return r, g, b

end;


All you need is to plug an IntSlider to the Samples node of the script component.
  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
Doesn't work right. Even with sample set at 1... smile:(
  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20
Nope... And I can't figure out why! smile:evil:
Hey, Sphinx, feel free to jump in and show us how it's really done smile;)
  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
Problem is

i = i - 1

FF doesn't like this
  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20
Changed it to
Quote
while (i >= 1) do
k = i
r1, g1, b1 = get_sample_map(x+i, y, SOURCE)
rr = rr + r1
gg = gg + g1
bb = bb + b1
i = k - 1
end;

And got the same result...
What makes you say it's i = i - 1?
  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
Quote
And got the same result...
What makes you say it's i = i - 1?

Good question. Please ignore that comment.

  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20

That makes both of us smile:D
  Details E-Mail
Casual Pixels
Dilettante

Posts: 96
Haven't ever scripted in FF, but I think you're both looking for this:

Code

function prepare()

end;

function get_sample(x, y)

   r = 0
   g = 0
   b = 0

   i = 0
   count = 12

   while ( i < count ) do

      ri, gi, bi = get_sample_map(x + i, y, SOURCE)

      r = r + ri
      g = g + gi
      b = b + bi

      i = i + 1

   end;

   return r, g, b

end;


I'm guessing you could probably move "count = 12" to the prepare() function.
  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
Gilles D I think you just about nailed it! smile:banana: smile:ff: smile:loveff:

Code

function prepare()

   count = get_intslider_input(SAMPLES)

end;

function get_sample(x, y)

   r = 0
   g = 0
   b = 0

   i = 0

   while ( i < count ) do

      ri, gi, bi = get_sample_map(x + i, y, SOURCE)

      r = r + ri
      g = g + gi
      b = b + bi

      i = i + 1

   end;

   return r, g, b

end;
  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20
Can anyone point me to how this is different from what I did?
  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
Quote
Can anyone point me to how this is different from what I did?

The fact that works? smile;) smile:D
  Details E-Mail
Carl
c r v a

Posts: 7289
Filters: 82
had a bit of fun with your test filters, you guys are progressing, look forward to the final version to play with, I can't script either so can't really help smile:)
  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
woop!

Thanks to Morgantao and Gilles D!

uberBlend ZOOM!.ffxml
  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
Bit niftier...

uberBlend ZOOM 2!.ffxml
  Details E-Mail
Ghislaine
Ghislaine

Posts: 3142
Filters: 270
smile:?: Must be Chinese ... ! smile:?:
  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
Warp speed!

  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
Next step is to get alpha working along with a "normal" blend mode.
Once again I have no idea how to do this... smile:D
  Details E-Mail
Ghislaine
Ghislaine

Posts: 3142
Filters: 270
Love this firework ! Hoping you'll find the receipe.
  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
I believe the normal/alpha mode is described here...

http://www.filterforge.com/forum/read...8&TID=7492
  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20
Quote
Uberzev wrote:
The fact that works?


I was begging for this, wasn't I smile:D
Lemme rephrase the question: Where did I go wrong with my script?

Quote
Next step is to get alpha working along with a "normal" blend mode

I know the LUA script API has at least 2 blend modes built into it.
All the rest can be done with math mambo jumbo, that I'm not gonna pretend to understand smile:D
  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
Quote
I know the LUA script API has at least 2 blend modes built into it.
All the rest can be done with math mambo jumbo, that I'm not gonna pretend to understand
The math for the blend modes is described pretty succinctly here.

The tricky part is how to implement a "normal" mode that respects alpha channels.
  Details E-Mail
Skybase
2D/3D Generalist

Posts: 4025
Filters: 76
Wait this does work for non-square ratios? (although it seems a simple fix) just wondering.
  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
Quote
Wait this does work for non-square ratios? (although it seems a simple fix) just wondering.
No reason it shouldn't but my mind thinks square when using FF. smile:)
  Details E-Mail
Casual Pixels
Dilettante

Posts: 96
Quote
(Morgantao) Can anyone point me to how this is different from what I did?


It's all in exactly when the running totals get reset to zero. In the original code, I guessed (correctly, apparently) that prepare() gets executed only once, while get_sample(...) gets called once per pixel.

So by having the r = 0, etc in prepare(), the total started at zero and for every single pixel, it accumulated a running sum.

My version sets the total back to zero for each pixel, so the sum at the end of get_sample(...) is the sum of the twelve values.

Cheers!
  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20
Well done then Gilles smile:)
Seems odd to me that you need to reset the r, g and b values back to zero for each pixel smile:|
I thought the whole point in get_sample(...) is to return the RGB value of THAT pixel.
Also I'm not sure how not resetting the RGB value between pixels gives strange squares instead of circles.

Again, thanks for fixing the script, and well done catching the problem. smile:)
  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
Ok so about that Normal+Alpha blend mode. Anyone who codes it gets a free copy of FF Pro courtesy of moi.
  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20
By Normal+Alpha blend you mean the same as a multiblend with more than 7 layers, correct?
  Details E-Mail
Sphinx.
Filter Optimizer

Posts: 1750
Filters: 39
Ah nice to see some new scripters emerge smile8) You can use the build in blend functions of FF3: http://www.filterforge.com/features/v...t-api.html
  Details E-Mail
Morgantao
Can't script

Posts: 2185
Filters: 20
Looks like I was right, the API makes it really straight forward. Not too much math needed.

The first example on that link shows how to use Normal blend with alpha between two layers.
If what you want is to do is an uberMultiBlend, you need to loop the blend_normal() function as many layers as you have, just like in the uberBlend script.
  Details E-Mail
uberzev
not lyftzev

Posts: 1890
Filters: 36
Quote
By Normal+Alpha blend you mean the same as a multiblend with more than 7 layers, correct?

Yup
  Details E-Mail

Messages 1 - 45 of 119
First | Prev. | 1 2 3 | Next | Last 

Join Our Community!

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

33,711 Registered Users
+18 new in 30 days!

153,531 Posts
+39 new in 30 days!

15,347 Topics
+72 new in year!

Create an Account

Online Users Last minute:

27 unregistered users.