Author Archive for Thomas

ExtendScript - Use Flash in Photshop, Illustrator and InDesign

While doing some general research on which technologies are good to use if you're doing generative artwork I stumbled upon ExtendScript. It is an extended implementation of JavaScript which can be used to control and automate the major Adobe Creative Suite Applications beeing Photoshop, Illustrator and InDesign. Since CS3 Flash can be used to build the GUI for using ExtendScript in these Applications.

Just to start here is a great tutorial how you can get this up and running using Flex, but it's generally the same using just plain Actionscript in combination with ExternalInterface. Developing Flash Windows for Photoshop Using Flex

Oh and here you can find the Documentation for ExtendScript:

http://www.adobe.com/devnet/photoshop/scripting/
http://www.adobe.com/devnet/illustrator/scripting/

So why am I so amazed about this possibility? Even though by now I've just read the docs and didn't try it myself I see a great possibility here:

AS Drawing API->PS output?

What if you could just script using normal, native Flash Actionscript Drawing API but send the output to Photoshop or Illustrator?

See the benefits and possibilities:

  • Simple output as *.psd or *.ai file for further editing, compositing, exporting,...
  • Use the powerful Photoshop and Illustrator Tools directly from Flash - no need for replicating behavior with AS Classes.
  • Break the 2880px barrier by just using Flash as a scaled down Preview Window - the real output is in whatever size you need directly in Photoshop.
  • I wonder what else you might come up with...

One major thing I'm not too sure about yet is performance. So there is need for further research. If I missed some Infos about this please let me know.

Otherwise check back soon as I will publish any result here soon.

Magic Moments - net.culture.space

Yesterday I was at a wonderful exhibition opening at the net.culture.space which is a branch of the well known Ars Electronica Center.

The exhibition is called "Magic Moments" and aims to break the barriers between the real and the digital world. At beginning they were quoting Arthur C. Clarke which really brings it to the point: "Any sufficiently advanced technology is indistinguishable from magic."

There was a lot of fantastic stuff, to see more go to flickr or http://www.netculturespace.at/ausstellungen/ausblick.

Especially "Godmode" by Tim Knapen was very fascinating. He hacked a copier so if you scanned drawn characters they started to move and animate along the ceiling. The wondeful thing was that it needed no explanation, it just worked. Draw it, press the "copy-Button" and watch your drawing live!

Malewitsch

So still inspired by the same exhibition now this work started from Malewitsch's work Suprematist Composition: Airplane Flying but as I continued to work on it it grew bigger and bigger...

Click on the Stage - Just play a bit if you like. Or scroll down for a more detailed description on the adjustable parameters and how it works.

Check my flickr account (widget on the right) for nice stuff I created with this tool.

Controls on/off - Show/Hide the whole Options panel

Clear - Clears the Stage

Overlap - Allow/Disallow overlapping of Shapes

Width/Height/Rotation - Adjust Width/Height/Rotation of the Shapes

Dirt - Decide how much the Rectangle should be transformed

Random Malewitsch Colors - Stick to the colors from Suprematist Composition: Airplane Flying being Red, Blue, Yellow and Black

Random Colors - Randomly pick a color with every click

Choose Color - Pick a color yourself by entering a HEX Code

Now just some words on the Script itself.

First some tribute to stuff I used:

Again Grant Skinners awesome seeded Random Class.

Keith Peters MinimalComps for the Controls.

And now just two snippets from my Source which might be interesting.

 
var test_width:uint = 1 + dist * 2;
var x:Number;
var y:Number;
if (dist_iteration < Math.pow(test_width,2)) {
	do {
	x = (dist_iteration % test_width) - dist;
	y = Math.floor(dist_iteration / test_width) - dist;
	dist_iteration++;
	}
	while(Math.abs(x)<dist && Math.abs(y)<dist);
}else{
dist++;
dist_iteration = 1;
x = -dist;
y = -dist;
}
 

This starts from a certain point 0,0 and then returns coordinates in concentric rectangles around the initial point. Combined with the next snippet (Collision detection) this was used to find an empty sport close to where you click.

The next snippets checks for an empty spot (white) on bitmap where a shape can be put. It could still use some work as it currently assumes that 0,0 is the same for the Bitmap and the Shape. It also only handles x,y and rotation applied to the shape, no scaling or other adjustments. But for now it does it's job quite well.

 
public static function check(shape:Shape,bitmapData:BitmapData):Boolean {
	var tempBmpData:BitmapData = new BitmapData(shape.width, shape.height, true, 0xFFFFFF);
	var matrix:Matrix = new Matrix();
	var rotation:Number = 2 * Math.PI * (shape.rotation / 360);
	matrix.rotate(rotation);
	matrix.translate(shape.width/2, shape.height/2);
	tempBmpData.draw(shape,matrix);
 
	var tempBmpDataSource:BitmapData = new BitmapData(shape.width, shape.height, true, 0xFFFFFF);
	var matrix2:Matrix = new Matrix();
	matrix2.translate(-shape.x+shape.width/2,-shape.y+shape.height/2);
	tempBmpDataSource.draw(bitmapData, matrix2);
 
	var empty:Boolean = tempBmpData.hitTest(new Point(0, 0), 0xFF, tempBmpDataSource, new Point(0, 0), 0xFF);
	tempBmpData.dispose();
	tempBmpDataSource.dispose();
 
	return(empty)
}
 

Mondrian

Some days ago I was at an exhibition and when I looked at Mondrians Composition III I just had to do that.
Click at the picture to draw a new one.

Oh and I used the excellent seeded Random Class by Grant Skinner so the results are random but seeded which means they will be the same whenever you come back to see the show again.

Welcome!

Welcome at my new Blog!

If you're interested in more details on Who? Why? What? Please have a look at the about page.