Skip to content

Commit 8cd0ee2

Browse files
committed
Adds missing files for #22
1 parent baa2060 commit 8cd0ee2

File tree

7 files changed

+896
-0
lines changed

7 files changed

+896
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/* Example for an ASCII-Art effect
2+
* Move the mouse from left to right to change the font size
3+
* or press the left mouse button to see the original image.
4+
*
5+
* Author: Nick 'Milchreis' Müller
6+
*/
7+
8+
import milchreis.imageprocessing.*;
9+
10+
PImage image;
11+
12+
void setup() {
13+
size(550, 550);
14+
// Load image
15+
image = loadImage(dataPath("example.jpg"));
16+
}
17+
18+
void draw() {
19+
20+
if(mousePressed == true) {
21+
image(image, 0, 0);
22+
} else {
23+
24+
int fontSize = (int) map(mouseX, 0, width, 8, 128);
25+
int foregroundColor = 0;
26+
int backgroundColor = 255;
27+
boolean toneInColor = true;
28+
PImage asciiImage = ASCII.apply(image, ASCII.SHORT_SET, fontSize, foregroundColor, backgroundColor, toneInColor);
29+
30+
image(asciiImage, 0, 0);
31+
32+
// You can also use:
33+
// ASCII.apply(PImage input);
34+
// ASCII.apply(PImage input, String characterset);
35+
// ASCII.apply(PImage input, String characterset, int fontSize);
36+
}
37+
}
378 KB
Loading

img/ASCII.png

281 KB
Loading

0 commit comments

Comments
 (0)