Stroep

Just a collection of random works – Mark Knol

Tag Archives: flash

Generative curved series (0)

January 26th, 2009, under Generative art.

New experiments with movements, curves, lines and perlin noise. Most movements are created using this function (this is pseudo code)

sprite.point1.x += ( -128 + noiseColor.green) / 5;
sprite.point1.y += ( -128 + noiseColor.blue) / 5;          
 

noiseColor is the colorvalue of getPixel() from the perlin noise.

ribbon.curve-09

ribbon.leaf-06 ribbon.leaf-02
ribbon.leaf-07 ribbon.curve-10

Some curves with gradient fills and 2 different stroke sizes. I found in the Matrix-class a createGradientBox() function, witch actually is a very cool and handy function. The colors are based on photos with cool colors, this gives a nice natural look.

curves-354247508 curves-90797965
curves-120014133

Tagged with , , .

After writing this post of using perlin noise, I’ll did some more experiments making cool things. I draw lines using Perlin noise as input. Check this out:

I was also experimenting/figuring out how to convert a actionscript generated movie to video. I never knew it was possible (or that easy) with the Flash CS3 (maybe because I never tried). Just choose file > export movie > and choose .mov extension. The video isn’t smooth, because (when I save it) it is not really rendering, it’s just like an invisible screencapture, I guess. So I can’t use more heavy CPU things. Thats a pity.

But maybe I could use my ImageSaver Class to create a movie-sequence by saving frame by frame as PNG.

Tagged with , , , , , , .

Hot AS3 art (1)

October 30th, 2008, under Generative art.

It took a while to get the right feeling, but I’m very happy with the results. Generated with actionscript, colorized with Photoshop. Orginal render size is 4800×4800 px. It’s full of details!

hot.01

hot.01 detail hot.03 detail

hot.02

hot.03 hot.02 detail

Tagged with , , , , .

50s.design.ribbon.01 50s.design.ribbon.03

Sometimes I don’t know what to think of generative art. I don’t know if these images I created could be called (or what ‘they’ called) art, or if they are just some other renders. Sometimes it feels nothing more than lines, colors. Some people who see it really love it, but at some moments I don’t know how to think about it.

senseless.colors.04 senseless.colors.06

But take a look at it, they have so many details (see the big sizes if you have a flickr account). I cannot count the lines, but can have a endless watch to see if there’s a message in it. A secret sign or something else I didn’t coded. How can such useless lines be that interesting? I don’t get it..

flower.02

A lot of people ask me how to create this images. If you don’t want to learn to code, just freak out with photoshop. First, when you really want to this: learn a coding-language, like actionscript. Download a nice actionscript-editor, like FlashDevelop. This makes coding more easily & comfortable. You also could learn processing. I don’t know a lot about it, but I’ve seen wonderful things created with it.

Tagged with , , , , .

wire.move (5)

September 29th, 2008, under Generative art.

I just had an idea for a new generative render, so I started a some simple line tests. I calculated a motion-path. Around this path are moving multiple other sprites, that’s why we see a chain-like-line. Click to see high-res larger images (1200×1200 px)

wire.move wire.move test wire.move second wire.move


That looked nice to me. I modified the code, to add some colors to it and make a better composition. The first 2 are some test with color and borderwidth, so you could see the process.

wire.move test with color wire.move small wire.move color wire.move more color

wire.move color

I’m kinda happy with this result. Maybe I generate a 10.000×10.000 render of this one, so I could print it at large format.

Tagged with , , , , .

Generated with actionscript 3.0. Just experimenting with some new motion.

fake.shapes

fake.shapes

fake.shapes

There’s more on my Flickr Account.

Tagged with , , .

Looking for class to save images? Check out ImageSaver.as

I’m experimenting with AIR, because I heard saving a ByteArray ( for example encoded PNG or JPG ) should be quite simple. You don’t need PHP or another serverside script for this, just write directly on you disk. Well, just check it out.

See this example of how to get it work. The image will be save on the same directory as your AIR application.

// use adobe’s encoder to create a byteArray
var jpgEncoder:JPGEncoder = new JPGEncoder( 60 );
var byteArray:ByteArray = jpgEncoder.encode( bitmapData );

// set an filename
var filename:String = "cool-image.jpg";

// get current path
var file:File = File.applicationDirectory.resolvePath( filename );

// get the native path
var wr:File = new File( file.nativePath );

// create filestream
var stream:FileStream = new FileStream();

//  open/create the file, set the filemode to write in order to save.
stream.open( wr , FileMode.WRITE);

// write your byteArray into the file.
stream.writeBytes ( byteArray, 0, byteArray.length );

// close the file.
stream.close();

// That’s it.
 

Is that it? This would be a boring post if I stopped right now ;)
I experimented to create a colorful cool wallpaper using AS3 only and save it using AIR. If you don’t got AIR or just don’t want to use it, I recommend using my ImageSave class.

Cool wallpaper created with AS3

This is my code to create this wallpaper:
Feel free to play with the code, but post a link to your experiment / wallpaper here.

package
{
    import com.adobe.images.*;
    import flash.display.*;
    import flash.events.*;
    import flash.filesystem.*;
    import flash.filters.*;
    import flash.geom.*;
    import flash.text.*;
    import flash.utils.*;
    import nl.stroep.utils.*;
   
    public class Main extends Sprite
    {
        public function Main():void
        {          
            var bitmapData:BitmapData = new BitmapData (1280, 1024, false, 0×000000 );
           
            // create colorful radial lines
            var shape:Shape = new Shape();
            shape.graphics.moveTo ((bitmapData.width/2), (bitmapData.height/2))
            for (var i:Number = 0; i < 1900; i++)
            {
                // create some weird colors using sinus
                shape.graphics.lineStyle( 30, (Math.sin( i * 9 ) * i / 200) * 0xffffff, 0.4 );
                // do some weird sin/cos moves
                shape.graphics.lineTo ((bitmapData.width/2) + (Math.sin( i/3 )*i/2),  (bitmapData.height/2) + (Math.cos( i/3 )*i/2) );
            }                  
            // add it multiple times using other blendmodes, isn’t that what we do all the time in PhotoShop?
            bitmapData.draw ( shape, null, null, BlendMode.NORMAL );
            bitmapData.draw ( shape, null, null, BlendMode.ADD );
            bitmapData.draw ( shape, null, null, BlendMode.MULTIPLY );
            bitmapData.draw ( shape, null, null, BlendMode.OVERLAY );
            // cool! filters! Add some blur to our lines to make a nice blurry background
            bitmapData.applyFilter( bitmapData, bitmapData.rect, new Point() , new BlurFilter( 40, 40, 5 ) );
           
            // create colorful radial lines
            var anotherShape:Shape = new Shape();
            anotherShape.graphics.moveTo ((bitmapData.width/2), (bitmapData.height/2) );       
            for (var j:Number = 0; j < 1900; j++)
            {              
                // create some weird lines with weird sizes
                var lineWidth:Number = 50((j / 50) >> 0);
                var color:Number = (Math.sin( j ) * j / 200) * 0xFFFFFF
                anotherShape.graphics.lineStyle( lineWidth, color, 0.2, false, LineScaleMode.NORMAL, CapsStyle.SQUARE, JointStyle.MITER );
                anotherShape.graphics.lineTo ((bitmapData.width/2) + (Math.sin( j/3 )*j/2),  (bitmapData.height/2) + (Math.cos( j/4 )*j/2) );
            }   
            // cool! filters! Add some blur to our lines to make a little blurry
            bitmapData.applyFilter( bitmapData, bitmapData.rect, new Point() , new BlurFilter( 5, 5, 5 ) );
            // blendmode ADD is awesome
            bitmapData.draw ( anotherShape, null, null, BlendMode.OVERLAY );
           
            // create some text
            var textfield:TextField = new TextField ();
            textfield.antiAliasType = AntiAliasType.NORMAL;
            textfield.htmlText = "<font face=’Arial’ color=’#FFFFFF’ size=’60′>FUN WITH BITMAPDATA</font> <br/> <font face=’verdana’ color=’#FFFFFF’ size=’20′><B>CREATE YOUR OWN WALLPAPER WITH FLASH</b></font>";
            textfield.autoSize = TextFieldAutoSize.LEFT;           
           
            // cool! filters! Add blur to your text
            textfield.filters = [ new BlurFilter(20,20,3) ]
           
            // draw textfield into bitmapdata, and use a matrix to set its position to center screen
            bitmapData.draw ( textfield, new Matrix( 1, 0, 0, 1, (bitmapData.width/2)(textfield.textWidth/2) ,(bitmapData.height/2)(textfield.textHeight/2)), null, BlendMode.ADD);          
                   
            // reset the filters, just add DropShadow
            textfield.filters = [ new DropShadowFilter( 0, 45, 0, 0.3, 5, 5, 2, 5 ) ]
           
            // draw textfield again
            bitmapData.draw ( textfield, new Matrix( 1, 0, 0, 1, (bitmapData.width/2)(textfield.textWidth/2) ,(bitmapData.height/2)(textfield.textHeight/2) ) );         
           
            // show the bitmapData, just add it to the stage, using the Bitmap Class
            this.addChild ( new Bitmap ( bitmapData ) )

            // use adobe’s encoder to create a byteArray
            var jpgEncoder:JPGEncoder = new JPGEncoder( 60 );
            var byteArray:ByteArray = jpgEncoder.encode( bitmapData );

            // set an filename
            var filename:String = "cool-wallpaper.jpg";

            // get current path
            var file:File = File.applicationDirectory.resolvePath( filename );

            // get the native path
            var wr:File = new File( file.nativePath );

            // create filestream
            var stream:FileStream = new FileStream();

            //  open/create the file, set the filemode to write; because we are going to save
            stream.open( wr , FileMode.WRITE);

            // write your byteArray into the file.
            stream.writeBytes ( byteArray, 0, byteArray.length );

            // close the file. That’s it.
            stream.close();
                   
        }      
    }
}

Tagged with , , , , .