Pixel Bender: Flash vs After Effects

This blog usually isn’t for industry commentary and such, but you know, when Adobe starts moving the pixels around in new ways I do get excited.

Adobe’s “Pixel Bender” framework — which facilitates fast, cross-platform, single-frame image-processing filters — will be available in Flash and After Effects, and presumably other imaging apps as well. (It should be useful in Photoshop and Illustrator and Premiere.)

Adobe developer Tinic Uro reveals some important differences between Flash 10’s support, and After Effects’.

In particular, on Flash, a Pixel Bender filter runs on the host CPU, not the graphics card! But not to worry, they’re still mighty fast; they’re compiled to native Intel code on the fly. Ah, right, yes, they’ll be slooow on PPC Macintoshes. So it goes.

On After Effects, however, they’ll run on the GPU.

Couple of relevant links:

Adobe Flash 10 beta download
Adobe Pixel Bender Toolkit download
Mr Doob, some guy with a lot of cool Pixel Bender examples (found via AEPortal, thanks!)
Pixelero’s cool examples, too (also via aeportal)

After Effects CS4: Pixel Bender!

Ah! Ah! Yes. Ok. Here’s the rather understated but incredibly-significant feature added in CS4: Pixel Bender effects.

Keven Goldsmith of Adobe explains.

Pixel Bender is Adobe’s way of packaging up (essentially) OpenGL Shader Language, for use as effects plugins to their imaging products.

The outcome will be a lot of extremely cool effects plugins. Some of these will be old effects that run much faster, meaning we can use them more freely. Some of these will new effects that would have been prohibitively slow, but are now merely non-realtime.

This is getting good.

After Effects CS4: Yawn?

Ok. Here’s my obligatory chime-in on CS4.

It’s too soon to tell. And I know I’ll upgrade anyway. But So far it looks pretty unspectacular!

When I first started After Effectsing (to verb a product) it was just after expressions were introduced, and just before scripting (scripting!) was added. Those were the days!

And then CS3, that was all right. Puppet tool is pretty cool. I haven’t much cottoned to shapes. The graph editor… there’s things about the old one I liked better.

And floating-point color was in there somewhere along the way too.

Great stuff!

Anyway, about CS4. Let’s see…

Adobe info here and here.

Let’s get bullety.

  • User interface change, window renamed from The Smoother to Smoother. Smoother than what? It had to be said.
  • Compositions for mobile devices. Ok.
  • Animate X, Y, and Z positions independently. Could already do this just fine with slider controls and expressions thanks.

Ok, here’s two I like:

  • Handle 3d photoshop files. This is a good direction! I certainly look forward to ever more 3d features!
  • XML file format. Ok. God I’m geeky, but this is really important! You can save to .aep or .aepx. The XML flavor can, of course, be edited (or maybe created from scratch). But the doc cautions against using .aepx as your primary file format. Also, not everything is rendered as text; much is hex-coded binary. So, overall, probably better to stick with scripting to modify your projects, for now.

I suspect that there’s been ongoing under-the-hood work being done, which will eventually manifest as the real new features.

But for this release, it seems, well, pretty LITE.

Still, can’t wait to try it out!

Omino Dialog Maker for ExtendScript

ExtendScript

My favorite Adobe applications are all scriptable. They use a scripting language called ExtendScript. I think it’s pure and compliant JavaScript (aka EcmaScript)… if it has any deviations, it’s in some subtle fashion that hasn’t affected me.

One thing you frequently need in a script is a means to gather input choices, so the script can be flexible. I rolled something up that handles this for many simple situations. I call it the Omino Dialog Maker. It’s a software library that lets you bring up an input dialog with just a couple of lines of code. It is mostly about 2 years old now, works pretty well.

Omino Dialog Maker

Here’s a simple example of a dialog made with the Omino Dialog Maker.

And here’s the code to produce it:

#include "ominoDialogMaker.jsx"

var omd = newOminoDialog("Example Omino Dialog");

omd.number("a number","n",88.21);
omd.string("a string","s","your name here");
var result = omd.run();

if(result == null)
	alert("Cancelled\nYou clicked \"cancel\".");
else
	alert("n is " + result.n + ", and s is \"" + result.s + "\"");

That’s pretty handy, isn’t it? As you can see, omd.run() populates a result variable with the contents of the dialog.

I admit it: tt’s not the best possible dialog and layout. It’s a little clunky looking. But it gets the job done, lets me type in a few numbers and set meat of the script to work.

More UI Elements

Here’s a dialog which shows the various UI elements supported by Omino Dialogs:

And, here’s the code which produced it:

#include "ominoDialogMaker.jsx"
function go()
{
	// setting up a dialog is easy. you can add entries for basic types of
	// string and number, and checkbox and radio buttons, and the
	// dialog is presented reasonably, with very little work.

	var omd = newOminoDialog("Example Omino Dialog");

	omd.boxedText(5,"This is an example of an Omino Dialog. It runs \n"
		+ "with After Effects, Illustrator, and Photoshop, or just in the\n"
		+ "ExtendScript toolkit itself. It can handle simple parameter types."
		+ " (Running in " + app.name + " v" + app.version + ")"
	);
	omd.number("a number","n",15.7);
	omd.string("a string","s","a text value");
	omd.separator();
	omd.sectionLabel("basics");
	omd.checkbox("a checkbox","x",true,"subtitle");
	omd.menu("a menu","menu","cherries",["apples","bananas","cherries","dates","figs"]);
	omd.radioButtons("Choose One","r","red",["red","maroon","scarlet","crimson"]);
	omd.separator();
	omd.sectionLabel("files");
	omd.openFile("a file","jpgFileName","foo.jpg","Choose a JPEG File",".jpg");
	omd.selectFolder("a folder","folderName","/tmp","Choose a folder");
	omd.saveFile("save as","gifFileName","foo.gif","Save as GIF",".gif");s

	// when we "run" the dialog, we get back a result variable.
	// if you hit CANCEL, then the result is null.
	// if you hit OK, then the values are populated into the result.

	// note: you can kill photoshop by running the dialog from ExtendScript toolkit, then halting
	// the script with the dialog still up.

	var result = omd.run();

	if(result == null)
		alert("Cancelled\nYou clicked \"cancel\".");
	else
	{
		var s = "result from dialog:\n";
		for(var f in result)
			s += "   " + f + " := " + result[f] + "\n";
		alert(s);
	}
}
go();

If you’ve read this far, you’re hopefully asking, “Gee, where can I get the actual library?” Here’s the code, shown directly out of my source code repository. Download with the download button.

http://omino.com/src/adobe_scripts/omino_adobe_script_suite/src/shared/ominoDialogMaker.jsx in new window download http://omino.com/src/adobe_scripts/omino_adobe_script_suite/src/shared/ominoDialogMaker.jsx to file hide http://omino.com/src/adobe_scripts/omino_adobe_script_suite/src/shared/ominoDialogMaker.jsx

 

Trivia: UI Differences Across Adobe Applications

Omino Dialog Maker can be used for scripts in After Effects, Photoshop, and Illustrator, at least, and possibly other Adobe applications. I have noticed that the dialogs look slightly different in each of these apps! Not critically… For reference, here are screen shots from several.

tv static

Sometimes you just have to take joy from trivia. Here’s a little tv-static animated GIF I made, for use with a WordPress plugin.

Feel free to steal and use this gif.

It’s only 6 frames, 128×128, 18k.
It is tileable, and looks pretty good, large!

Here’s the after effects project for it.

It’s just Noise, Fast Blur, Curves, and Offset. The Offset filter is used to reduce the visibility of the seams, by mixing two layers.

I guess that’s all.

Jumped the Gun

stargif.swf

click for
/pixelblog/content/2008/ominoSuite/stargif.swf
stargif2.swf

click for
/pixelblog/content/2008/ominoSuite/stargif2.swf

If you tried to download the Windows version of the Omino After Effects Suite and had a negative experience: Please accept my apologies. I jumped the gun on the “release”. Lessons learned (something about DLL’s and testing, thanks).

On the plus side: http://omino.com/sw/ominoAeSuite/ has the fixed download. Confirmed to download and run on 3, count ‘em, 3 computers other than my own.

(The only issues were with download/unzip; once running, they are reliable and stable. More stable than Particle Playground ha ha.)

Especial thanks to Mike K at Muonics for dragging me kicking and writhing into the necessary knowledge of manifests, linker choices.

Omino After Effects Suite

The next release of the Omino After Effects Suite is finally available! Oh, it’s got a fabulous new Kaleidoscope effect, mentioned in the previous post. But the real excitement is… is… is this:

Mac OS X Universal Binary, and Windows! The two most requested features, doncha know.

In truth the Windows version should be considered Alpha. I’m confident that it works and is stable (as is the Mac version) but I’m still learning my way around the compiler settings, so it may run slower than necessary.

Oh, speaking of performance, there’s a handy feature in every single Omino Suite plug-in: a performance measurement.

Under the “debug” twirldown are options to display all the parameters, and the render time. These are both mostly to help me while developing the plugin; stamping the parameters creates a video record of possible outcomes. But the time stamp is actually quite handy while authoring, to give some idea of which settings are likely to take more, well, render time.

I’ll be posting a few more examples of usages of the Omino Suite. Stay tuned.

Note to Adobe. Free idea: show a performance measurement for each plugin. The application knows when each starts and stops and could do that. Sure, confounded a bit by threading, &c, but still.

Kaleidoscope Plugin

My partner (of the non-business variety) recently built a beautiful oversized kaleidoscope for part of an artistic installation. Here’s a picture taken from within:

glasswaterscope

I can’t seem to find a picture of the device itself, but it stands about 3 feet tall, a foot across. With cardboard mock wrought-iron corners. And fused glass inserts. And a velvet-lined eyepiece. Anyway, I got to wondering about simulating kaleidoscopes. After Effects ships with CC Kaleida, which is a little bit nifty, but it only does arrangements of square mirrors. I wanted more flexibility. Actually, I wanted complete flexibility. So, I wrote omino kaleidoscope.

Blueprinty Kaleido

Its features include:

  • Use any path to define a set of mirrors
  • Set the shininess of the mirrors, so successive reflections may be dimmer
  • Set a distortion amount, similar to tilting the mirrors a bit
  • Set the number of reflections (fewer will render faster, but with less expanse)
  • …and a few futz values that change some numbers, in the, the, you know, the math, that make it become more cool.

And here’s a demonstration of omino kaleidoscope:

iYKalOgNsEM

click for
http://www.youtube.com/v/iYKalOgNsEM&rel=0&color1=0x402061&color2=0x9461ca&border=0
This will be available in the next, soon, upcoming (!) release of the omino after effects suite.

Man Versus Computer (another render speed tip)

Here’s another tip for improving render speed. Don’t laugh, this actually does work.

Disable the computer’s “sleep if no user activity” timeout.

I had mine set for three hours, nice and green you know? (On Mac OS X, the control panel for this feature has a light bulb for its icon.) But it turned my 6 hour render into… well… I came home from work and it was still unfinished from the night before. Because the computer was sleeping.

Works for all render applications.

Thwok.

Now, as to why After Effects doesn’t tickle the Mac’s timout API to say “i am here, i am here” is a very very good question.

Puppet Tool versus Motion Blur

The puppet tool (in After Effects CS3) sure is neat. Like “bones” — common in many 3d programs — for 2d images. Great for expressive animation. Morphy!

And motion blur is one of my favorite flavors of ketchup. Up there with drop shadows and glow.

But yee, put them together and After Effects renders most terrible slow. My puppeted comp renders about 5 frames per second without motion blur, and about 5 seconds per frame with motion blur. So, say, a factor of 25 slower.

I wish I was posting something fun and exotic about scripts or halftoning or clever optical effects… but right now the issue of “render time” is using up all of my AE angst. But soon!

« Previous Page« Previous entries « Previous Page · Next Page » Next entries »Next Page »