Posts Tagged ‘Pixel Bender’

HSV kernel

Sunday, May 9th, 2010

The HSV kernel has been added to PixelBender Kernel Tester, which controls the colors of pixels based on the HSV model.

PixelBender Kernel Tester


Classic photo slideshow

Sunday, March 21st, 2010

For a trial run of the PixelBlender kernel, I’ve implemented a slideshow that randomly retrieves recently updated photos from flickr.
The pictures turned into a somewhat faded classic tone, scrolling slowly on the stage, as if they had sneaked out from the nostalgic past that didn’t really exist.

PixelBender Kernel Tester

Sunday, March 21st, 2010

Whilst playing with Pixel Bender, I felt that I needed an environment to quickly test the kernels on the flash runtime, so as to see the actual results and performance.
Pixel Bender Kernel Tester was created for this purpose. All the parameters of the kernels can be tweaked with the slider controls, just like in the PixelBender IDE. And in addition to the static preview, the effect can be applied repeatedly so that, for example, an effect like fade in/out across the time can be observed.
The source code for all of them are available via the ’source’ button.




Pixel Bender – Chroma key filter

Monday, January 4th, 2010

As a study of Pixel Bender, I wrote a very rough chroma key filter that makes a specified range of colors transparent. This is my first time working on Pixel Bender, but it turned out to be quite simple as it didn’t take me more than half an hour to make this demo after downloading the reference.
The result may look clumsy, I admit, but the poor movie that I took with a mobile phone should be blamed rather than the filter itself.

<languageVersion : 1.0;>

kernel ChromaKey
<   namespace : "info.kynd";
    vendor : "kynd.info";
    version : 1;
    description : "makes specified range of colors transparent";
>
{
    input image4 src;
    output pixel4 dst;

    parameter float4 keyColor
    <
        minValue: float4(0.0, 0.0, 0.0, 0.0);
        maxValue: float4(1.0, 1.0, 1.0, 1.0);
        defaultValue: float4(0.0, 0.0, 0.0, 1.0);
        description: "color that is used for keying";
    >;
    parameter float range
    <
        minValue: 0.0;
        maxValue: 1.0;
        defaultValue: 0.0;
        description: "range of color that the filter is applied";
    >;

    void
    evaluatePixel()
    {
        float4 color = sampleNearest(src,outCoord());
        float dist = distance(color, keyColor);
        if (dist <= range) {
            dst = float4(0.0, 0.0, 0.0, 0.0);
        } else {
            dst = color;
        }
    }
}
Related Posts with Thumbnails