I wanted to create a portrait with my fav words and cute text faces! When the mouse is pressed, the pixel colors are in black and white.
Here is how it looks after some time.
![](wp-content/uploads/2022/11/Screen-Shot-2022-11-05-at-7.56.40-PM.png)
sketch
// Sowang Kundeling Project 09 Section C
var img;
var imgbw;
var texts = ["( ͡° ͜ʖ ͡°)", "(づ。◕‿‿◕。)づ", "(◕‿◕✿)", "(ᵔᴥᵔ)", "♥‿♥", "~(˘▾˘~)", "ᕦ(ò_óˇ)ᕤ", "(。◕‿◕。)", "ʕ•ᴥ•ʔ", "corn", "taco", "cat"];
function preload(){
//load image
img = loadImage("https://i.imgur.com/1V17iyS.png");
imgbw = loadImage("https://i.imgur.com/qedFJ3f.jpg")
frameRate(10000);
}
function setup() {
createCanvas(350, 350);
//img.resize(450, 450);
//imageMode(CENTER);
//textMode(CENTER);
}
function draw() {
//image(img, 0, 0, 400, 400);
var x = random(img.width); // random coordinate for the pixel
var y = random(img.height);
var pixelColor = img.get(x*5, y*5); // pixel color
var pixelColorbw = imgbw.get(x*5, y*5) // black and white pixel color
if(mouseIsPressed) { // creates black and white pixels when mouse is pressed
fill(pixelColorbw);
}else {
fill(pixelColor);
}
strokeWeight(random(5,20));
textSize(random(5, 20));
text(random(texts), x, y);
}