27
May
09

CIBarsSwipe Glitch Updated Code

Here’s an even simpler version of the same thing, just using one image input. The result looks pretty-much the same.

/*
Glitch effect exploiting the CoreImage Bars Swipe transition effect.
toneburst 2009
*/

function __image main(__image Image, __number Threshold) {
// Input image width
var width = Image.extent.width;
// Init output image
var outImg;

if(Math.random() < Threshold) { // Glitch Pass 1 var Angle = (Math.random() < 0.5) ? 0 : 1.57; var Width = Math.random() * width; var BarOffset = Math.random() * 100; var Time = Math.random() * 0.25; var outImg = Filter.CIBarsSwipeTransition(Image, Image, Angle, Width, BarOffset, Time); } else if (Math.random() < Threshold) { // Glitch Pass 2 var Angle = (Math.random() < 0.5) ? 1.57 : 0; var Width = Math.random() * width; var BarOffset = Math.random() * 100; var Time = Math.random() * 0.25; outImg = Filter.CIBarsSwipeTransition(outImg, Image, Angle, Width, BarOffset, Time); } else { outImg = Image; } // Return output image return outImg; }[/code]

Advertisements

2 Responses to “CIBarsSwipe Glitch Updated Code”


  1. 1 grischa
    May 27, 2009 at 11:25 pm

    hi alex,
    nice filter_ but how to get rid of the green background?
    (or just change the color) ;is it be possible inside the filter?

    g

    • 2 toneburst
      May 28, 2009 at 9:07 am

      Hiya!

      Green background? I don’t get that here. Are you using a Clear patch at the top level of your composition? You should have a Clear, or you’ll get video junk.

      Hope this helps.

      a|x


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Twitter

May 2009
M T W T F S S
« Apr   Jun »
 123
45678910
11121314151617
18192021222324
25262728293031

Links

Blog Stats

  • 470,209 hits

%d bloggers like this: