[PixelBender] FuzzyDistort filter

A few months ago i made a filter in PixelBender Toolkit for use in flash.
This filter is named: FuzzyDistort; it distorts an image in a fuzzy way.

Demo:
Fuzzy Distort





































Download here: FuzzyDistort.pbj

And heres the code ( it says ‘actionscript’ but its actually PixelBender code ):

View CodeACTIONSCRIPT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<languageversion>
/*****************************************************************************
 *
 * Author: Robin Kollau
 * http://blog.rackdoll.nl
 * Contact: rackdoll -at- gmail.com
 *
 *****************************************************************************/
kernel FuzzyDistort
&lt;  namespace   : "Your Namespace";
    vendor      : "Robin Kollau";
    version     : 1;
    description : "Distorts the image in a fuzzy way.";
&gt;
{
    input image4 src;
    output pixel4 dst;
 
    parameter float Amplitude
    &lt;
        minValue:    float( 0  );
        maxValue:    float( 25 );
        defaultValue:float( 0  );
 
    &gt;;  
 
    parameter float Multiplier
    &lt;
        minValue:      float(  1 );
        maxValue:      float( 25 );
        defaultValue:  float(  1 );
 
    &gt;;
 
    void
   evaluatePixel()
    {
        float2 xy = outCoord();
        xy += Amplitude * cos( xy.yx ) * Multiplier;
        dst = sampleNearest( src, xy );
    }
}
</languageversion>


Have fun!

Comments are closed.


Categories
Archives
LinkedIn
R. Kollau