{"id":68206,"date":"2021-10-29T10:44:27","date_gmt":"2021-10-29T14:44:27","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/?p=68206"},"modified":"2021-10-29T10:44:27","modified_gmt":"2021-10-29T14:44:27","slug":"computational-portrait","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/29\/computational-portrait\/","title":{"rendered":"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>At first I really did not know how to start off with my portrait. I looked and reread the timeline for a while until I decided I wanted to do some sort of recreation of Chuck Close&rsquo;s portraits. Instead of using colors to create skin tone, I ended up sticking with the pixel colors that I got using .get for my images. It took me the longest to set up my photo than to actually get my random walk to work.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"878\" height=\"1024\" src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-27-at-10.31.40-AM-878x1024.png\" alt=\"\" class=\"wp-image-68209\" srcset=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-27-at-10.31.40-AM-878x1024.png 878w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-27-at-10.31.40-AM-257x300.png 257w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-27-at-10.31.40-AM-768x896.png 768w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-27-at-10.31.40-AM.png 1180w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\"><figcaption>Figuring Out pixel size<\/figcaption><\/figure><figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"873\" height=\"1024\" src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-27-at-10.32.12-AM-873x1024.png\" alt=\"\" class=\"wp-image-68208\" srcset=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-27-at-10.32.12-AM-873x1024.png 873w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-27-at-10.32.12-AM-256x300.png 256w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-27-at-10.32.12-AM-768x901.png 768w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-27-at-10.32.12-AM.png 1175w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\"><figcaption>Playing around with accuracy in pixel size<\/figcaption><\/figure><p>So to get my work to be more like Close&rsquo;s I made an array of two different size circles inside my pixels. I thought this looked really cool but I was hoping to get more definition in my features by doing this.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"880\" height=\"1024\" src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-27-at-10.49.26-AM-880x1024.png\" alt=\"\" class=\"wp-image-68207\" srcset=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-27-at-10.49.26-AM-880x1024.png 880w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-27-at-10.49.26-AM-258x300.png 258w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-27-at-10.49.26-AM-768x894.png 768w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-27-at-10.49.26-AM-1200x1397.png 1200w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Screen-Shot-2021-10-27-at-10.49.26-AM.png 1224w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\"><figcaption>Circles and Squares<\/figcaption><\/figure><p>So I ended up using my Ipad to make a grid of areas in the face that I wanted to be more or less pixelated. I ended up counting and working from this top image to make sure I was using the right constrains in my for loops. I probably could have shortened my code for this project, but I was happy with how it was so I did not bother.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"712\" height=\"1024\" src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Untitled_Artwork-1-712x1024.png\" alt=\"\" class=\"wp-image-68210\" srcset=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Untitled_Artwork-1-712x1024.png 712w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Untitled_Artwork-1-208x300.png 208w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Untitled_Artwork-1-768x1105.png 768w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Untitled_Artwork-1-1067x1536.png 1067w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Untitled_Artwork-1-1423x2048.png 1423w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Untitled_Artwork-1-1200x1727.png 1200w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/Untitled_Artwork-1.png 1640w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\"><figcaption>Figuring out proportions<\/figcaption><\/figure><p>So, for every new and smaller square I was building I was also making my two circles on the top, unless the pixels got too small. I played around with the numbers a lot here. I felt that my image was very stagnant and decided to use noise to get my circles to vibrate in certain parameters. I thought doing this was quite funny because it reminded my a bit of the saying that the Mona Lisas eyes follow you across the room and, I felt that my entire face was doing the same.<\/p>\n\n\n\n<p><a class=\"p5_sketch_link\" data-width=\"400\" data-height=\"400\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/uploads\/2021\/10\/sketch-132.js\">file&gt;<\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"400\" height=\"400\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">var noiseParam = 0;\nvar noiseStep = 0.1;\nvar img;\nfunction preload(){\n   img = loadImage(\"https:\/\/i.imgur.com\/5n4h1dT.png\");\n}\n\n\nfunction setup() {\n    img.resize(img.width\/3, img.height\/3);\/\/pixel image info\n    createCanvas(img.width, img.height * .9);\n}\nfunction main(dx,dy){\n    for(var col = 0; col &lt; img.width; col += 8){ \/\/main\n        for(var row = 0; row &lt; img.height; row += 8){\n            var c = img.get(col,row);\n            fill(color(c));\n            noStroke();\n            rect(col,row,8,8);\n            ellipse((col + 4) + dx, (row - 4) + dy, 6, 6);\n            ellipse((col + 4) + dx, (row - 12) + dy, 3, 3);\n        }\n    }\n}\n\nfunction face(){\n    for(var col = 88; col &lt; 248; col += 6){ \/\/whole face\n        for(var row = 120; row &lt; 320 ; row += 6){\n            var c = img.get(col, row);\n            fill(color(c));\n            noStroke();\n            rect((col + 1.5), (row + 1.5), 5, 5);\n            ellipse((col + 5.5) + dx, (row - 4) + dy, 5, 5);\n            ellipse((col + 5.5) + dx, (row - 10) + dy, 2.5, 2.5);\n        }\n    }\n}\n\nfunction mainFeature(){\n    for(var col = 104; col &lt; 230; col += 4){ \/\/clarity for face features == more pixels\n        for(var row = 160; row &lt; 216 ; row += 4){\n            var c = img.get(col,row);\n            fill(color(c));\n            noStroke();\n            rect((col + 4.5), (row + 4.5), 3, 3);\n            ellipse((col + 8.5) + dx , (row - 4) + dy, 2, 2);\n            ellipse((col + 8.5) + dx , (row - 6) + dy, 1.5, 1.5);\n        } \n    }\n\n    for(var col = 128; col &lt; 186; col += 4){ \/\/cont.\n        for(var row = 216; row &lt; 296 ; row += 4){\n            var c = img.get(col,row);\n            fill(color(c));\n            noStroke();\n            rect((col + 4.5), (row + 4.5), 3, 3);\n            ellipse((col + 8.5) + dx ,(row - 4) + dy, 2, 2);\n            ellipse((col + 8.5) + dx , (row - 6) + dy, 1.5, 1.5);\n\n        }\n    }\n}\n\nfunction eyes(){\n    for(var col = 104; col &lt; 136; col += 2){ \/\/eye area 1: no circle, too small\n        for(var row = 184; row &lt; 216 ; row += 2){\n            var c = img.get(col,row);\n            fill(color(c));\n            noStroke();\n            rect((col + 6.5), (row + 6.5), 1, 1);\n        }\n    }\n    for(var col = 176; col &lt; 232; col += 2){ \/\/eye area 2: no circle, too small\n        for(var row = 184; row &lt; 216 ; row += 2){\n            var c = img.get(col, row);\n            fill(color(c));\n            noStroke();\n            rect((col + 6.5), (row + 6.5), 1, 1);\n        }\n    }\n}\n\nfunction draw() {\n    background(0);\n    var offset = noise(noiseParam);\n    offset = map(offset, 0, 1, -8, 8);\n    dx = offset;\n    dy = offset;\n    main(dx, dy);\n    face(dx, dy);\n    mainFeature(dx, dy);\n    eyes(dx, dy);\n    noiseParam += noiseStep;\n}\n<\/code><\/pre><\/p>\n\n\n\n<p><\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>At first I really did not know how to start off with my portrait. I looked and reread the timeline for a while until I decided I wanted to do some sort of recreation of Chuck Close&rsquo;s portraits. Instead of using colors to create skin tone, I ended up sticking with the pixel colors that &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/2021\/10\/29\/computational-portrait\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Computational Portrait&#8221;<\/span><\/a><\/p>\n","protected":false},"author":660,"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\/68206"}],"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\/660"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/comments?post=68206"}],"version-history":[{"count":11,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/68206\/revisions"}],"predecessor-version":[{"id":68626,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/posts\/68206\/revisions\/68626"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/media?parent=68206"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/categories?post=68206"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2021\/wp-json\/wp\/v2\/tags?post=68206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}