{"id":75261,"date":"2022-11-05T21:11:56","date_gmt":"2022-11-06T01:11:56","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/?p=75261"},"modified":"2022-11-08T13:07:07","modified_gmt":"2022-11-08T18:07:07","slug":"project-09","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/11\/05\/project-09\/","title":{"rendered":"Project 09"},"content":{"rendered":"<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<html><body><p>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.<\/p>\n\n\n\n<p>Here is how it looks after some time.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" width=\"650\" height=\"586\" src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/11\/Screen-Shot-2022-11-05-at-7.56.40-PM.png\" alt=\"\" class=\"wp-image-75262\" srcset=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/11\/Screen-Shot-2022-11-05-at-7.56.40-PM.png 650w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/11\/Screen-Shot-2022-11-05-at-7.56.40-PM-300x270.png 300w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\"><\/figure><div><a class=\"p5_sketch_link\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/11\/sketch-17.js\" data-width=\"350\" data-height=\"350\">sketch<\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"350\" height=\"350\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">\/\/ Sowang Kundeling Project 09 Section C\n\nvar img;\nvar imgbw;\nvar texts = [\"( &#865;&deg; &#860;&#662; &#865;&deg;)\", \"(&#12389;&#65377;&#9685;&#8255;&#8255;&#9685;&#65377;)&#12389;\", \"(&#9685;&#8255;&#9685;&#10047;)\", \"(&#7508;&#7461;&#7508;)\", \"&hearts;&#8255;&hearts;\", \"~(&#728;&#9662;&#728;~)\", \"&#5478;(&ograve;_&oacute;&#711;)&#5476;\", \"(&#65377;&#9685;&#8255;&#9685;&#65377;)\", \"&#661;&bull;&#7461;&bull;&#660;\", \"corn\", \"taco\", \"cat\"];\n\nfunction preload(){\n  \/\/load image\n  img = loadImage(\"https:\/\/i.imgur.com\/1V17iyS.png\");\n  imgbw = loadImage(\"https:\/\/i.imgur.com\/qedFJ3f.jpg\")\n  frameRate(10000);\n}\n\n\nfunction setup() {\n    createCanvas(350, 350);\n    \/\/img.resize(450, 450);\n    \/\/imageMode(CENTER);\n    \/\/textMode(CENTER);\n}\n\n\nfunction draw() {\n    \/\/image(img, 0, 0, 400, 400);\n    var x = random(img.width); \/\/ random coordinate for the pixel\n    var y = random(img.height);\n\n    var pixelColor = img.get(x*5, y*5); \/\/ pixel color\n    var pixelColorbw = imgbw.get(x*5, y*5) \/\/ black and white pixel color\n  \n    if(mouseIsPressed) { \/\/ creates black and white pixels when mouse is pressed\n      fill(pixelColorbw);\n    }else {\n      fill(pixelColor);\n    }\n\n    strokeWeight(random(5,20));\n    textSize(random(5, 20));\n    text(random(texts), x, y);\n}<\/code><\/pre><\/div><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>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. sketch \/\/ Sowang Kundeling Project 09 Section C var img; var imgbw; var texts = [&#8220;( &#865;&deg; &#860;&#662; &#865;&deg;)&#8221;, &#8220;(&#12389;&#65377;&#9685;&#8255;&#8255;&#9685;&#65377;)&#12389;&#8221;, &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/11\/05\/project-09\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 09&#8221;<\/span><\/a><\/p>\n","protected":false},"author":731,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[111,57],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/75261"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/users\/731"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/comments?post=75261"}],"version-history":[{"count":1,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/75261\/revisions"}],"predecessor-version":[{"id":75263,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/75261\/revisions\/75263"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/media?parent=75261"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/categories?post=75261"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/tags?post=75261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}