26
May
09

Glitches With CIBarsSwipe Effect

Check the ‘Edit Filter Function’ option on a CoreImage Filter patch, and paste the following into the JavaScript panel:

/*
Glitch effect using the Apple CIBarsSwipeTransition effect.
*/

function __image main(__image Image0, __image Image1, __number Threshold) {

var outImg;
Threshold = 1 – Threshold;

if(Math.random() > Threshold) {
var Angle = (Math.random() < 0.5) ? 0 : 1.57; var Width = Math.random() * Image0.extent.width; var BarOffset = Math.random() * 100; var Time = Math.random() * 0.25; var outImg = Filter.CIBarsSwipeTransition(Image0, Image1, Angle, Width, BarOffset, Time); var Angle = (Math.random() < 0.5) ? 1.57 : 0; var Width = Math.random() * Image0.extent.width; var BarOffset = Math.random() * 100; var Time = Math.random() * 0.25; outImg = Filter.CIBarsSwipeTransition(outImg, Image1, Angle, Width, BarOffset, Time); } else { outImg = Image0; } // Return output image return outImg; }[/code] Feed in 2 different inputs, or time-delayed (via Queue patch) version of same image. Instant glitch! Threshold value should be between 0 and 1, and determines likelihood of any given frame glitching, with higher values making it less likely the current frame will pass through unscathed. Note, this could all be done with QC's builtin patches, since BarsSwipe Transition is a standard patch, but I liked the idea of doing it all in one neat little CIFilter.

Advertisements

4 Responses to “Glitches With CIBarsSwipe Effect”


  1. 1 Rob
    May 26, 2009 at 11:39 pm

    Hey alex, this is really great! Did you write this from scratch or is it a conversion?

  2. 2 toneburst
    May 27, 2009 at 7:33 am

    Hi Rob,

    cheers!
    All my own work, this one. You could actually do exactly the same thing by connecting-together lots of builtin patches, since the BarsSwipe Transition is one of the standard QC patches. I just like the idea of keeping things neat, and doing it all in the one CIFilter patch though.

    a|x

  3. 3 George Toledo
    May 31, 2009 at 4:30 am

    Awesome… I knew that post I made on built in glitches would get some coolness happening. This was a great idea tb.


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

  • 474,728 hits

%d bloggers like this: