Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b8d018a
commit e9482b8
Showing
6 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
*.class | ||
.DS_Store | ||
|
||
# Package Files # | ||
*.jar | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} | ||
|
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |