{"id":68403,"date":"2021-10-31T17:17:52","date_gmt":"2021-10-31T21:17:52","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=68403"},"modified":"2021-10-31T17:17:52","modified_gmt":"2021-10-31T21:17:52","slug":"project-9-computational-portrait","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/31\/project-9-computational-portrait\/","title":{"rendered":"Project 9: Computational Portrait"},"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><a class=\"p5_sketch_link\" data-width=\"320\" data-height=\"480\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/sketch-147.js\">sketch<\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"320\" height=\"480\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">var img;\nvar diameter;\n\nfunction preload() {\n    img = loadImage(\"https:\/\/i.imgur.com\/VzFWKC5.jpg\");\n}\n\nfunction setup() {\n    createCanvas(320, 480);\n    image(img, 0, 0, 320, 480);\n    background(110);\n}\n\nfunction draw() {\n    noStroke();\n    x = random(2000);\n    y = random(2992);\n    c = img.get(x, y);\n    fill(c);\n    if (x &lt; 1500 & x > 300 && y < 2000 && y > 550) {\n        diameter = 10;\n    } else {\n        diameter = 20;\n    }\n    circle((x * 0.16), (y * .16), diameter);\n}<\/code><\/pre><\/p>\n\n\n\n<p><\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>sketch var img; var diameter; function preload() { img = loadImage(&#8220;https:\/\/i.imgur.com\/VzFWKC5.jpg&#8221;); } function setup() { createCanvas(320, 480); image(img, 0, 0, 320, 480); background(110); } function draw() { noStroke(); x = random(2000); y = random(2992); c = img.get(x, y); fill(c); if (x &lt; 1500 &#038; x > 300 &#038;&#038; y < 2000 &#038;&#038; y > 550) &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/31\/project-9-computational-portrait\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 9: Computational Portrait&#8221;<\/span><\/a><\/p>\n","protected":false},"author":681,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[111,58,1],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/68403"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/users\/681"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=68403"}],"version-history":[{"count":2,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/68403\/revisions"}],"predecessor-version":[{"id":68406,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/68403\/revisions\/68406"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=68403"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=68403"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=68403"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}