{"id":68543,"date":"2021-11-01T15:09:40","date_gmt":"2021-11-01T19:09:40","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=68543"},"modified":"2021-11-01T15:10:26","modified_gmt":"2021-11-01T19:10:26","slug":"project-9-computational-portrait-4","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/11\/01\/project-9-computational-portrait-4\/","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>For my portrait, I knew I wanted to do something where the user of my program could participate in while creating the portrait. I really enjoy active interactions in my pieces within design, so I&rsquo;ve been trying to bring that into my coding work as well. So, I decided that the way to do that was to create a click and drag style generator, where the user drags around their mouse to &ldquo;paint&rdquo; my portrait. From there, I created randomly generated &ldquo;pixels&rdquo; within a certain radius of the mouse, to add an element of randomization to the &ldquo;painting&rdquo;. Finally, because it was taking me a long time to actually paint the portrait and I found that annoying, I added in a larger &ldquo;brush&rdquo; size through the use of larger random pixels. I think the final outcome is pretty cool, I like how it came out.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"768\" src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/11\/65684362254__C9121163-0A1C-4549-AF20-85167A6E7300-1024x768.jpg\" alt=\"\" class=\"wp-image-68544\" srcset=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/11\/65684362254__C9121163-0A1C-4549-AF20-85167A6E7300-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/11\/65684362254__C9121163-0A1C-4549-AF20-85167A6E7300-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/11\/65684362254__C9121163-0A1C-4549-AF20-85167A6E7300-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/11\/65684362254__C9121163-0A1C-4549-AF20-85167A6E7300-1536x1152.jpg 1536w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/11\/65684362254__C9121163-0A1C-4549-AF20-85167A6E7300-2048x1536.jpg 2048w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/11\/65684362254__C9121163-0A1C-4549-AF20-85167A6E7300-1200x900.jpg 1200w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\"><figcaption>Original photo from this last Monday<\/figcaption><\/figure><figure class=\"wp-block-gallery columns-2 is-cropped\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" width=\"680\" height=\"956\" src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/11\/Screen-Shot-2021-11-01-at-2.55.41-PM-1.png\" alt=\"\" data-id=\"68547\" data-full-url=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/11\/Screen-Shot-2021-11-01-at-2.55.41-PM-1.png\" data-link=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?attachment_id=68547\" class=\"wp-image-68547\" srcset=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/11\/Screen-Shot-2021-11-01-at-2.55.41-PM-1.png 680w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/11\/Screen-Shot-2021-11-01-at-2.55.41-PM-1-213x300.png 213w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\"><\/figure><\/li><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" width=\"680\" height=\"956\" src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/11\/Screen-Shot-2021-11-01-at-3.00.45-PM-1.png\" alt=\"\" data-id=\"68548\" data-full-url=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/11\/Screen-Shot-2021-11-01-at-3.00.45-PM-1.png\" data-link=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?attachment_id=68548\" class=\"wp-image-68548\" srcset=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/11\/Screen-Shot-2021-11-01-at-3.00.45-PM-1.png 680w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/11\/Screen-Shot-2021-11-01-at-3.00.45-PM-1-213x300.png 213w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\"><\/figure><\/li><\/ul><figcaption class=\"blocks-gallery-caption\">Portrait with just the large pixels (L) and with the smaller pixels added (R)<\/figcaption><\/figure><p><a class=\"p5_sketch_link\" data-width=\"340\" data-height=\"480\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/11\/sketch-5.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=\"340\" height=\"480\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">\/\/Elise Chapman\n\/\/ejchapma\n\/\/ejchapma@andrew.cmu.edu\n\/\/Section D\n\nvar erSelfie; \/\/image storage\n\n\/\/loads the image to be used\nfunction preload() {\n    erSelfie = loadImage('https:\/\/i.imgur.com\/GbuQVul.jpg?1');\n}\n\nfunction setup() {\n    createCanvas(340,480);\n    imageMode(CENTER);\n    noStroke();\n    background(200);\n}\n\nfunction draw() {\n    \/\/ gives radius to the area in which random pixels can appear\n    var xPos=random(-10,10);\n    var yPos=random(-10,10);\n    \/\/ gives the mouse access to the entire image's pixels\n    var x = map(mouseX, 0, width, 0, 2117);\n    var y = map(mouseY, 0, height, 0, 3000);\n    var pixSize;\n    var pix = erSelfie.get(x, y); \/\/color of pixel\n    if (mouseIsPressed) {\n        push();\n        translate(mouseX,mouseY);\n        fill(pix);\n        \/\/ option for large or small pixel generation\n        if (keyIsPressed) {\n            pixSize=random(10,20);\n        } else {\n            pixSize=random(1,10);\n        }\n        ellipse(xPos, yPos, pixSize);\n        pop();\n    }\n}\n<\/code><\/pre><\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>For my portrait, I knew I wanted to do something where the user of my program could participate in while creating the portrait. I really enjoy active interactions in my pieces within design, so I&rsquo;ve been trying to bring that into my coding work as well. So, I decided that the way to do that &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/11\/01\/project-9-computational-portrait-4\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 9: Computational Portrait&#8221;<\/span><\/a><\/p>\n","protected":false},"author":644,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[111,58],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/68543"}],"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\/644"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=68543"}],"version-history":[{"count":2,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/68543\/revisions"}],"predecessor-version":[{"id":68551,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/68543\/revisions\/68551"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=68543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=68543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=68543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}