diff --git a/Label_maker.pde b/Label_maker.pde new file mode 100644 index 0000000..a2502ba --- /dev/null +++ b/Label_maker.pde @@ -0,0 +1,31 @@ +PImage photo, sourceImage, maskImage; + +IntList palette; + +void setup(){ + fullScreen(); + smooth(); + + palette = new IntList(); + palette.append(color(0, 10, 20)); + + photo = loadImage("Macaw-Feathers.jpg"); + image(photo, 0, 0, width, height); + saveFrame("data/source.png"); + background(0); + generateMaskShapes(50); + saveFrame("data/mask.png"); + maskImage = loadImage("mask.png"); + sourceImage = loadImage("source.png"); + sourceImage.mask(maskImage); + background(random(0,255), random(0,255), random(0,255)); + image(sourceImage, 0, 0); + //generateOverlayShapes(20); + saveFrame("data/output" + year() + month() + day() + hour() + minute() + second() + ".png"); + println(width); + println(height); +} + +void draw(){ + exit(); +} \ No newline at end of file diff --git a/Shapes.pde b/Shapes.pde new file mode 100644 index 0000000..897a4ce --- /dev/null +++ b/Shapes.pde @@ -0,0 +1,50 @@ + +void generateMaskShapes(int _num_shapes) { + fill(255); + noStroke(); + for (int i = 0; i < _num_shapes; i++) { + float randX = random(0, width); + float randY = random(0, height); + float randDia = random(100, 400); + pushMatrix(); + translate(randX, randY); + rotate(random(0, PI)); + + int randomiser = int(random(0, 3)); + if (randomiser == 0) { //draw a rectangle + rectMode(CENTER); + rect(0, 0, randDia, randDia); // Black rectangle + } else if (randomiser == 1) { //draw a circle + ellipseMode(CENTER); + ellipse(0, 0, randDia, randDia); // Black ellipse + } else { + triangle(randX - randDia/2, randY + randDia/2, randX, randY - randDia/2, randX + randDia/2, randY + randDia/2); + } + popMatrix(); + } +} + +void generateOverlayShapes(int _num_shapes) { + noStroke(); + for (int i = 0; i < _num_shapes; i++) { + fill(random(0, 255), random(0, 255), random(0, 255), 100); + float randX = random(0, width); + float randY = random(0, height); + float randDia = random(100, 400); + pushMatrix(); + translate(randX, randY); + rotate(random(0, PI)); + + int randomiser = int(random(0, 3)); + if (randomiser == 0) { //draw a rectangle + rectMode(CENTER); + rect(0, 0, randDia, randDia); // Black rectangle + } else if (randomiser == 1) { //draw a circle + ellipseMode(CENTER); + ellipse(0, 0, randDia, randDia); // Black ellipse + } else { + triangle(randX - randDia/2, randY + randDia/2, randX, randY - randDia/2, randX + randDia/2, randY + randDia/2); + } + popMatrix(); + } +} \ No newline at end of file diff --git a/data/.DS_Store b/data/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/data/.DS_Store differ diff --git a/data/Macaw-Feathers.jpg b/data/Macaw-Feathers.jpg new file mode 100644 index 0000000..66a670b Binary files /dev/null and b/data/Macaw-Feathers.jpg differ diff --git a/data/feather.jpg b/data/feather.jpg new file mode 100644 index 0000000..24a5550 Binary files /dev/null and b/data/feather.jpg differ diff --git a/data/flamingo.png b/data/flamingo.png new file mode 100644 index 0000000..96a3822 Binary files /dev/null and b/data/flamingo.png differ diff --git a/data/green.png b/data/green.png new file mode 100644 index 0000000..e42c882 Binary files /dev/null and b/data/green.png differ diff --git a/data/mask.png b/data/mask.png new file mode 100644 index 0000000..cff89c9 Binary files /dev/null and b/data/mask.png differ diff --git a/data/output20181014133934.png b/data/output20181014133934.png new file mode 100644 index 0000000..e11f455 Binary files /dev/null and b/data/output20181014133934.png differ diff --git a/data/output20181014134327.png b/data/output20181014134327.png new file mode 100644 index 0000000..e0bea39 Binary files /dev/null and b/data/output20181014134327.png differ diff --git a/data/output20181014134411.png b/data/output20181014134411.png new file mode 100644 index 0000000..17bb428 Binary files /dev/null and b/data/output20181014134411.png differ diff --git a/data/output20181014134529.png b/data/output20181014134529.png new file mode 100644 index 0000000..a9a3e43 Binary files /dev/null and b/data/output20181014134529.png differ diff --git a/data/output2018101413464.png b/data/output2018101413464.png new file mode 100644 index 0000000..4ae8904 Binary files /dev/null and b/data/output2018101413464.png differ diff --git a/data/output20181014144858.png b/data/output20181014144858.png new file mode 100644 index 0000000..f0ef531 Binary files /dev/null and b/data/output20181014144858.png differ diff --git a/data/output20181014144955.png b/data/output20181014144955.png new file mode 100644 index 0000000..39ddfef Binary files /dev/null and b/data/output20181014144955.png differ diff --git a/data/output20181015123932.png b/data/output20181015123932.png new file mode 100644 index 0000000..bdd3710 Binary files /dev/null and b/data/output20181015123932.png differ diff --git a/data/output20181015124034.png b/data/output20181015124034.png new file mode 100644 index 0000000..95e0786 Binary files /dev/null and b/data/output20181015124034.png differ diff --git a/data/output2018101512404.png b/data/output2018101512404.png new file mode 100644 index 0000000..c859fa7 Binary files /dev/null and b/data/output2018101512404.png differ diff --git a/data/output20181015124042.png b/data/output20181015124042.png new file mode 100644 index 0000000..c47a0da Binary files /dev/null and b/data/output20181015124042.png differ diff --git a/data/output20181015124115.png b/data/output20181015124115.png new file mode 100644 index 0000000..03d9f6f Binary files /dev/null and b/data/output20181015124115.png differ diff --git a/data/source.png b/data/source.png new file mode 100644 index 0000000..b5943c4 Binary files /dev/null and b/data/source.png differ diff --git a/mask.png b/mask.png new file mode 100644 index 0000000..4dc03d1 Binary files /dev/null and b/mask.png differ diff --git a/output.png b/output.png new file mode 100644 index 0000000..cdd2b8f Binary files /dev/null and b/output.png differ diff --git a/output1.png b/output1.png new file mode 100644 index 0000000..abf9e7d Binary files /dev/null and b/output1.png differ diff --git a/output2.png b/output2.png new file mode 100644 index 0000000..b572e75 Binary files /dev/null and b/output2.png differ diff --git a/output3.png b/output3.png new file mode 100644 index 0000000..178bbdb Binary files /dev/null and b/output3.png differ