Skip to content

Commit

Permalink
First!
Browse files Browse the repository at this point in the history
  • Loading branch information
riebschlager committed Jan 13, 2013
1 parent b8d018a commit e9482b8
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,4 +1,5 @@
*.class
.DS_Store

# Package Files #
*.jar
Expand Down
48 changes: 48 additions & 0 deletions PixelPlaids/PixelPlaids.pde
@@ -0,0 +1,48 @@
PImage img;
int countH = 0;
int countV = 0;
int dirH = 1;
int dirV = 1;
PImage sliceH = new PImage();
PImage sliceV = new PImage();

void setup() {

// Set to your native desktop size to create a nice desktop background
size(1280, 720);

// Load an image and get started!
img = loadImage("img3.jpg");
img.loadPixels();
}

void draw() {
background(255);
if (countH < height && countV < width) {

// Grab a 1 pixel vertical slice and a 1 pixel horizontal slice.
// Grab thicker chunks to create interesting effects
PImage sliceH = img.get(0, countH, img.width, 1);
PImage sliceV = img.get(countV, 0, 1, img.height);

// Draw the horizontal slice and stretch it
image(sliceH, 0, 0, width, height);

// Play with the blend modes to create blend the layers
// http://processing.org/reference/blendMode_.html
blendMode(MULTIPLY);

// Now draw the horizontal slice
image(sliceV, 0, 0, width, height);

// NEXT!
countH++;
countV++;
}
}

void keyPressed(){
// See something you like? Hit a key to save it!
saveFrame();
}

Binary file added PixelPlaids/data/img1.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added PixelPlaids/data/img2.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added PixelPlaids/data/img3.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 14 additions & 1 deletion README.md
@@ -1,4 +1,17 @@
pixel-plaids
============

Have JPG, will plaid.
Have JPG, will plaid.

Load an image, slice it, stretch it and blend it.

examples
============

![PixelPlaid](http://farm9.staticflickr.com/8084/8376302645_04363f6917_z.jpg)

![PixelPlaid](http://farm9.staticflickr.com/8516/8377379246_94dd6d88c3_z.jpg)

![PixelPlaid](http://farm9.staticflickr.com/8193/8377380686_5390d2129e_z.jpg)

![PixelPlaid](http://farm9.staticflickr.com/8368/8377382120_27db6f4fd7_z.jpg)

0 comments on commit e9482b8

Please sign in to comment.