The Birdy Cloning Experiments

The Birdy Cloning Experiments

Come check out my game at www.BirdyClone.99k.org.

More info and screenshots here.
And tell your friends!

Advertisements
Image | Posted on by | Tagged , , , , , , , , , , | Leave a comment

Birdy Clone

Greetings all.  This is a video game I whipped up.  It is a clever riff on the winning flappy formula.  A flappy clone about cloning flappies.  It is called The Bird Cloning Experiments.  It is intended for mobile devices, but until I can get the apps working it is here for desk/laptop enjoyment.  Unfortunately the web version isn’t working on mobile browsers right now.  Or Firefox.  It works in Chrome.  You should use Chrome.

Link | Posted on by | Tagged , , , , , , , , | Leave a comment

Nova Scotia Human Rights Commission Poster

This poster was created using Gimp, Processing, and Flickr’s creative commons search engine. This work and the code used to create it are released under the creative commons, non-commercial, attribution license (cc-by-nc). The license holders for the faces are listed on the poster.

FinalPoster

This is a cell packing algorithm that isn’t really the most efficient. It requires a source image with text on it for the rest of the code to refer to. The dots are then coloured based on the brightness of source image. There is a bit of white space around the characters still, and I manually controlled the size of the dots instead of adjusting it dynamically, but the printed version looks alright, so I’m happy with it. Also I’m sure some of the functions at the end weren’t used, but I tend to just grab that big block of code and pop it into any sketch where I need to save an image.
CODE:

ArrayList cells;

PGraphics iBuff; // IMAGE BUFFER
PGraphics cBuff; // CELL BUFFER

PImage words;
PImage face;
PImage mask;
int numberOfFaces = 270;
int faceIndex = 0;

int cellMin;// = 30;//60;
int cellMax;// = 60;//120;

void setup() {
size(850, 550);
colorMode(HSB);

words = loadImage("words2.jpg");
mask = loadImage("mask.jpg");
nextFace();
cells = new ArrayList();
iBuff = createGraphics(1700, 1100);
iBuff.beginDraw();
iBuff.colorMode(HSB);
iBuff.image(words,0,0,iBuff.width,iBuff.height);
iBuff.endDraw();
//cBuff = createGraphics(5950, 3850);
cBuff = createGraphics(6800, 4400);
cBuff.beginDraw();
cBuff.colorMode(HSB);
cBuff.ellipseMode(CENTER);
cBuff.smooth();
//cBuff.imageMode(CENTER);
cBuff.background(255);
cBuff.endDraw();

cellMin = 20;
cellMax = 30;

for (int i=0; i<500; i++) {
cells.add(new Cell());
println(i + " of " + cells.size());
}

cellMin = 17;
cellMax = 27;

for (int i=0; i<800; i++) {
cells.add(new Cell());
println(i+500 + " of " + cells.size());
}
cellMin = 12;//30;
cellMax = 22;//60;

for (int i=0; i<600; i++) {
cells.add(new Cell());
println(i+1300 + " of " + cells.size());
}

cellMin = 9;
cellMax = 17;

for (int i=0; i<2300; i++) {
cells.add(new Cell());
println(i+2100 + " of " + cells.size());
}

cellMin = 5;
cellMax = 13;

for (int i=0; i0; i--)
{
Cell cell = (Cell) cells.get(i);
if(cell.cellSize == 0)
cells.remove(i);
}

for (int i=0; i50) {
//RED
H = (int)random(12) + 18;
S = (int)random(18) + 52;
B = 255;
}
else {
//GREEN
H = (int)random(10) + 73;
S = (int)random(27) + 27;
B = 220; //(int)((random(3)+1)*64);
}
color C = color(H, 200, B);
cellColour = C;

}

PVector getLocation() {
PVector result = new PVector(0, 0);
int tries = 0;
while (!OK && tries 1) {
checkCells(result);
}
checkLetters(result);
if (closestCellDist > cellMin) {
OK = true;
cellSize =(int) (((closestCellDist* 1.3 < cellMax) ? closestCellDist* 1.3 : cellMax) );
}
tries++;
}
if(tries == 40000) println("TOO MANY TRIES");
return result;
}

void checkLetters(PVector test) {
color C = iBuff.get((int)test.x,(int)test.y);
float dist = 1000;
if(brightness(C) 128)
dist = closestPixel(test,false);
if((dist*3) < closestCellDist)
closestCellDist = dist*3;

}

float closestPixel(PVector pixel, boolean inLetter) {

float result = 1000;
int x,y;
for(int i=0; i<cellMax; i++) {
for(int j=0; j 128){
float Dist = pixelDist((int)pixel.x,(int)pixel.y,x,y);
if(Dist < result) {
result = Dist;
//println("EdgeClipped");
}
}
}
else {
if(brightness(D) < 128){
float Dist = pixelDist((int)pixel.x,(int)pixel.y,x,y);
if(Dist < result) {
result = Dist;
//println("EdgeClipped");
}
}
}
}
}
return result;
}

float pixelDist(int p1x, int p1y, int p2x, int p2y) {
float result;
result = sq(p2x - p1x) + sq(p2y - p2y);
return result;
}

void checkCells(PVector test) {
for (int i=0;i<cells.size();i++) {
Cell cell = (Cell) cells.get(i);
if(closestCellDist < cellMin) {
i = cells.size();
}
else if((cellDist(test,cell)) < closestCellDist) {
closestCellDist = (cellDist(test,cell));
}
}
}

float cellDist(PVector v1, Cell v2) {
float dist = v1.dist(v2.cellLocation) - cellSize/2 - v2.cellSize/2;
return dist;
}

void drawCell() {
cBuff.beginDraw();
cBuff.fill(cellColour);
cBuff.noStroke();
float SCALE = 4;
//cBuff.ellipse(cellLocation.x*SCALE, cellLocation.y*SCALE, cellSize*SCALE, cellSize*SCALE);
cBuff.tint(hue(cellColour),saturation(cellColour),brightness(cellColour));
face.mask(mask);
//cBuff.blendMode(MULTIPLY);
cBuff.image(face,(cellLocation.x - (cellSize/2))*SCALE,(cellLocation.y-(cellSize/2))*SCALE,cellSize*SCALE,cellSize*SCALE);
cBuff.endDraw();
nextFace();
}
}

float polarToX(float theta, float rad) {
float x = rad * cos(theta);
return x;
}

float polarToY(float theta, float rad) {
float y = rad * sin(theta);
return y;
}

void saveImage(PImage IMG,String fileName) {
IMG.save(fileName);
println("IMAGE SAVED: "+fileName);
}
void saveImage(PImage IMG)
{
// you can use .tif .jpg .tga and .png files, just change the end of the next line
String fileName = getName()+".tif";
IMG.save(fileName);
println("IMAGE SAVED: "+fileName);
}
void saveImage(PImage IMG,int page)
{
// you can use .tif .jpg .tga and .png files, just change the end of the next line
String fileName = getName(page)+".jpg";
IMG.save(fileName);
println("IMAGE SAVED: "+fileName);
}

String getName(int page) {
String pageName = "Page";
String name;
if(page<10) {
name = pageName + "00" + page;
} else if(pagewidth || H>height) {
scl = (width/float(W)<(height/float(H)))
? width/float(W) : height/float(H);
} else {
scl = 1;
}
return scl;
}

Posted in Uncategorized | Tagged , , , , , | Leave a comment

so, Wordle’s are things then…

so I got all bored waiting for school to start, when I realized that my teacher had already emailed me the syllabus and I could start early! We’ll see how much I end up enjoying this class. The following are Wordle’s, like that’s a noun and they’re a thing. Really they are just fancy word clouds created by a simple browser app that I could’ve created had I thought of it first. The texts I chose are art related texts that I have had to/enjoyed/planned on reading (not in that order) that happened to be on my computer in selectable form. So I pushed this simple app with hundreds of pages of text and it only failed me twice. I was probably just too impatient though.



Posted in Uncategorized | Tagged , , , , , , , , , | Leave a comment

More Amazing Shots!

<p>

</p><p>This was on Canada Day.  Beautiful day for a walk on the waterfront, and a wonderful day for cloud watching.  The things they do, that we can not perceive is like visual poetry.  I started out on the waterfront people watching but after about 600 or so shots sofortbild borked while switching between programs.  By this time I was beginning to lament not just going straight to Citadel Hill.  The clouds were so perfect looking.  There are two reasons I am doing this I guess, one is for use in blue screening probably for live audio/visual performance and the other is just to make video compilation of time lapses of Halifax, mostly just for fun I guess.  I think I would enjoy scoring it (musically).  For the former though, I am looking for really good shots of just clouds though.  TimeLapse 9 went really well, in that the clouds are all going in the same direction and are very consistent.  This one went well because the clouds just exhibited some incredible behaviour that I am pretty sure I can isolate well.  These are all taken at 3000 x 2000 (roughly) pixels, so in the photo compiling process it shouldn’t be hard to zoom and pan while retaining HD resolution.  As for the latter of the two reasons for doing this, after catching beautiful clouds on the hill (and catching a nice tan) I returned to my original spot in the shade of a large mirrored building.  The density of passers-by and sailboats differs a bit in the two shots, but I think it should pan pretty well from the last (reflections) to the first (real).</p><p>This sort of brings up another topic, which is the program I wrote that compiles the images into a .mov file.  It is pretty simple.  It just zooms the large image to fit in an HD video, and sometimes moves the image up and down on the side that has some space left.  It being so simple is actually the only reason I haven’t published it.  I downloaded the Nikon NEF SDK today, which should allow me to add raw conversion to my process.  It would more than double the memory footprint I think, and I don’t know if it will work with processing so I may have to imitate my blessedly simple program in another language, but it would provide incredible control of the colour and quality of the work.  I am actually really excited to play with it.  But I’m not going to.  I have other important projects that require most of my attention this summer (I will surprise you all with that later), so I probably won’t get to work on that much until later.  Which is kind of sad because I plan on taking many more of these time lapses before I plan on finding the time to write the new program.</p><p>~keithk</p>

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , , , , , | Leave a comment

Ninth try is a charm!

OMFG, what a nice day this was.  I think this may be the best one yet, the clouds were just going in the direction I wanted them too.  I took photos at six second iterations this time to smooth it out some.

Posted in Uncategorized | Tagged , , , , , , , | Leave a comment

The following took place between 3:20 and 4:20pm, yesterday.

Again with the flickering problem, but there are some good useable parts.  This one is only 3 seconds between images, makes for much smoother scurrying and vehicles.

 
Posted in Uncategorized | Tagged , , , , , , , , , , , , , | Leave a comment