{"id":75430,"date":"2022-11-06T23:02:53","date_gmt":"2022-11-07T04:02:53","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/?p=75430"},"modified":"2022-11-06T23:02:53","modified_gmt":"2022-11-07T04:02:53","slug":"project-9-portrait-2","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/11\/06\/project-9-portrait-2\/","title":{"rendered":"Project 9 &#8211; 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>What is Beauty?<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/11\/Web-capture_6-11-2022_165928-1.jpeg\" alt=\"\" class=\"wp-image-75433\" width=\"288\" height=\"291\" srcset=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/11\/Web-capture_6-11-2022_165928-1.jpeg 710w, https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/11\/Web-capture_6-11-2022_165928-1-296x300.jpeg 296w\" sizes=\"(max-width: 288px) 85vw, 288px\"><\/figure><div><a class=\"p5_sketch_link\" data-width=\"480\" data-height=\"480\" href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/uploads\/2022\/11\/sketch-Copy-Copy-Copy.js\">sketch &ndash; Copy &ndash; Copy &ndash; Copy<\/a><iframe src=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-content\/plugins\/p5-embedder\/p5_iframe.html\" class=\"p5_exampleFrame\" width=\"480\" height=\"480\"><\/iframe><pre class=\"language-javascript\"><code class=\"p5_editor language-javascript\">\/\/ Ana Furtado \n\/\/ Section E\n\/\/ Project 9 Computational Portrait\n\/\/What is Beauty?\n\nlet img;\nlet smallPoint;\nlet largePoint; \n\nfunction preload() {\n    \/\/img = loadImage('https:\/\/i.imgur.com\/pl5VSHB.jpeg')\n    img = loadImage('https:\/\/i.imgur.com\/hxAyzbU.jpeg')\n}\n\nfunction setup() {\n    createCanvas(480, 480);\n    smallPoint = 10;\n    largePoint = 15;\n    img.resize(width, height);\n    imageMode(CENTER);\n    background(255);\n    noStroke(); \n    img.loadPixels();\n    frameRate(75);\n}\n\n\nfunction draw() {\n    \/\/paint the image using dots\n    let point = map(mouseX, 0, width, smallPoint, largePoint);\n    let x = floor(random(img.width));\n    let y = floor(random(img.height));\n    let pix= img.get(x,y);\n    fill(pix, 128);\n    \/\/fill(pix);\n    ellipse(x, y, point, point);\n\n    \/\/prints What is Beauty? across canvas in random places using image colors\n    wordtext = [\"What\", \"is\", \"Beauty?\"];\n    for (var i = 0; i &lt;3; i++) {\n        fill(pix);\n        textSize(random(1,15));\n        text(wordtext[floor(random(wordtext.length))], random(0,width), random(0,height));\n        \/\/floor gives less messages than round\n    }\n\n    \/\/paints\/ further distorts image using randomly placed line of image color \n    push();\n    stroke(pix);\n    let a = random(0,width);\n    let b = random(0,height);\n    line(a, b, a+10, b+10);\n    \/\/line(a, b+10, a+10, b);\n    pop();\n}\n\n    \n    <\/code><\/pre><\/div>\n\n\n<p>The most challenging part of this project was making all the different elements work to distort the existing image to create a new portrait. <\/p><\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>What is Beauty? sketch &ndash; Copy &ndash; Copy &ndash; Copy \/\/ Ana Furtado \/\/ Section E \/\/ Project 9 Computational Portrait \/\/What is Beauty? let img; let smallPoint; let largePoint; function preload() { \/\/img = loadImage(&#8216;https:\/\/i.imgur.com\/pl5VSHB.jpeg&#8217;) img = loadImage(&#8216;https:\/\/i.imgur.com\/hxAyzbU.jpeg&#8217;) } function setup() { createCanvas(480, 480); smallPoint = 10; largePoint = 15; img.resize(width, height); imageMode(CENTER); background(255); &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/2022\/11\/06\/project-9-portrait-2\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Project 9 &#8211; Portrait&#8221;<\/span><\/a><\/p>\n","protected":false},"author":749,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[111],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/75430"}],"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\/749"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/comments?post=75430"}],"version-history":[{"count":1,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/75430\/revisions"}],"predecessor-version":[{"id":75434,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/posts\/75430\/revisions\/75434"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/media?parent=75430"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/categories?post=75430"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/15-104\/f2022\/wp-json\/wp\/v2\/tags?post=75430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}