{"id":33,"date":"2012-11-26T00:21:16","date_gmt":"2012-11-26T07:21:16","guid":{"rendered":"https:\/\/blogs.ubc.ca\/kvalade\/?p=33"},"modified":"2012-11-26T00:21:16","modified_gmt":"2012-11-26T07:21:16","slug":"image-from-text-from-image","status":"publish","type":"post","link":"https:\/\/blogs.ubc.ca\/kvalade\/2012\/11\/26\/image-from-text-from-image\/","title":{"rendered":"Image from Text from Image?"},"content":{"rendered":"<p>Well, darn. It would have been nice to have a neat image just come right out of PIL for me.<\/p>\n<p>To continue from <a title=\"Technical Questions\" href=\"https:\/\/blogs.ubc.ca\/kvalade\/2012\/11\/25\/technical-questions\/\">last post&#8217;s experiment<\/a> &#8211; where I converted an existing picture to a string &#8211; I&#8217;m wondering what happens if I convert an image to a string and back again. Will it be the same as before?<\/p>\n<p>Answer: Yes, it will be the same before, but only if the same dimensions are used. Otherwise, everything goes crazy, as might be expected.<\/p>\n<p>Here, I am using this image, and converting is from a 1280 x 960px RGB picture to one that is 960 x 1280px RGB.<\/p>\n<div id=\"attachment_37\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/Refinery.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-37\" class=\"size-medium wp-image-37\" title=\"Refinery\" src=\"https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/Refinery-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/Refinery-300x225.jpg 300w, https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/Refinery-1024x768.jpg 1024w, https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/Refinery-400x300.jpg 400w, https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/Refinery.jpg 1280w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-37\" class=\"wp-caption-text\">Original &#8211; 1280 x 960px RGB<\/p><\/div>\n<div id=\"attachment_38\" style=\"width: 235px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/refineryFromString-960x1280.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-38\" class=\"size-medium wp-image-38\" title=\"Refinery 2\" src=\"https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/refineryFromString-960x1280-225x300.jpg\" alt=\"\" width=\"225\" height=\"300\" srcset=\"https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/refineryFromString-960x1280-225x300.jpg 225w, https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/refineryFromString-960x1280-768x1024.jpg 768w, https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/refineryFromString-960x1280.jpg 960w\" sizes=\"auto, (max-width: 225px) 100vw, 225px\" \/><\/a><p id=\"caption-attachment-38\" class=\"wp-caption-text\">960 x 1280px RGB<\/p><\/div>\n<p>The result is pretty weird. The photograph gets horizontally collapsed into thirds and is repeated in each one of those thirds.<\/p>\n<div id=\"attachment_39\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/refineryFromString-800x600.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-39\" class=\"size-medium wp-image-39\" title=\"Refinery - 800x600\" src=\"https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/refineryFromString-800x600-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/refineryFromString-800x600-300x225.jpg 300w, https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/refineryFromString-800x600-400x300.jpg 400w, https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/refineryFromString-800x600.jpg 800w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-39\" class=\"wp-caption-text\">800 x 600px RGB<\/p><\/div>\n<div id=\"attachment_40\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/refineryFromString-800x600-CMYK.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-40\" class=\"size-medium wp-image-40\" title=\"Refinery - 800x600 - CMYK\" src=\"https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/refineryFromString-800x600-CMYK-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/refineryFromString-800x600-CMYK-300x225.jpg 300w, https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/refineryFromString-800x600-CMYK-400x300.jpg 400w, https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/refineryFromString-800x600-CMYK.jpg 800w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-40\" class=\"wp-caption-text\">Refinery &#8211; 800&#215;600 &#8211; CMYK<\/p><\/div>\n<p>The last one is the same, but with a different color model &#8211; CMYK as opposed to RGB. The streetlights look almost floral.<\/p>\n<div id=\"attachment_42\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/refineryFromString-600x400-RGB.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-42\" class=\"size-medium wp-image-42\" title=\"Refinery - 600x400 - RGB\" src=\"https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/refineryFromString-600x400-RGB-300x200.jpg\" alt=\"\" width=\"300\" height=\"200\" srcset=\"https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/refineryFromString-600x400-RGB-300x200.jpg 300w, https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/refineryFromString-600x400-RGB-450x300.jpg 450w, https:\/\/blogs.ubc.ca\/kvalade\/files\/2012\/11\/refineryFromString-600x400-RGB.jpg 600w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-42\" class=\"wp-caption-text\">Refinery &#8211; 600&#215;400 &#8211; RGB<\/p><\/div>\n<p>You get the idea.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Well, darn. It would have been nice to have a neat image just come right out of PIL for me. To continue from last post&#8217;s experiment &#8211; where I converted an existing picture to a string &#8211; I&#8217;m wondering what &hellip; <a href=\"https:\/\/blogs.ubc.ca\/kvalade\/2012\/11\/26\/image-from-text-from-image\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":16181,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-33","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.ubc.ca\/kvalade\/wp-json\/wp\/v2\/posts\/33","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.ubc.ca\/kvalade\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.ubc.ca\/kvalade\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.ubc.ca\/kvalade\/wp-json\/wp\/v2\/users\/16181"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.ubc.ca\/kvalade\/wp-json\/wp\/v2\/comments?post=33"}],"version-history":[{"count":3,"href":"https:\/\/blogs.ubc.ca\/kvalade\/wp-json\/wp\/v2\/posts\/33\/revisions"}],"predecessor-version":[{"id":49,"href":"https:\/\/blogs.ubc.ca\/kvalade\/wp-json\/wp\/v2\/posts\/33\/revisions\/49"}],"wp:attachment":[{"href":"https:\/\/blogs.ubc.ca\/kvalade\/wp-json\/wp\/v2\/media?parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.ubc.ca\/kvalade\/wp-json\/wp\/v2\/categories?post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.ubc.ca\/kvalade\/wp-json\/wp\/v2\/tags?post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}