{"id":3953,"date":"2015-12-22T05:15:56","date_gmt":"2015-12-22T10:15:56","guid":{"rendered":"http:\/\/blog.mozilla.org\/ux\/?p=3953"},"modified":"2019-04-02T11:24:09","modified_gmt":"2019-04-02T15:24:09","slug":"firefox-os-customization-concept","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/ux\/2015\/12\/firefox-os-customization-concept\/","title":{"rendered":"Firefox OS Customization Concept"},"content":{"rendered":"<h2>Overview<\/h2>\n<p>Earlier this year, I had the privilege of working on concepting the future of Firefox OS visual design with a small team. As part of that exploration, I collaborated with front-end engineer Pavel Ivanov to see what we could do with user customization. Something we\u2019ve always wanted was to give users of all levels of comfort with technology the ability to theme their Firefox OS experience with a single action: by simply selecting an image from their library. We envisioned that we could take a user-selected photo and use it to create OS imagery such as wallpaper, as well as customize their ui colors. This tool could eventually be a responsive web app or become integrated as part of the OS settings app.<\/p>\n<p>On the visual side, we were exploring a new design language inspired by the pixel, a kind of playful homage to our engineering culture. We used it to create pattern imagery that would underpin the visuals for the entire OS. This was a natural starting point for the type of imagery that we would generate from the colors extracted from an image.<\/p>\n<div id=\"attachment_3956\" style=\"width: 970px\" class=\"wp-caption alignleft\"><a href=\"http:\/\/firefoxos-mozilla.sapp.io\/\" target=\"_blank\"><img aria-describedby=\"caption-attachment-3956\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-3956 size-full\" src=\"https:\/\/blog.mozilla.org\/ux\/files\/2015\/12\/3-960.png\" alt=\"Pattern Imagery from Firefox OS Visual Concept\" width=\"960\" height=\"540\" srcset=\"https:\/\/blog.mozilla.org\/ux\/files\/2015\/12\/3-960.png 960w, https:\/\/blog.mozilla.org\/ux\/files\/2015\/12\/3-960-252x142.png 252w, https:\/\/blog.mozilla.org\/ux\/files\/2015\/12\/3-960-600x338.png 600w\" sizes=\"(max-width: 960px) 100vw, 960px\" \/><\/a><p id=\"caption-attachment-3956\" class=\"wp-caption-text\">Pattern Imagery from Firefox OS Visual Concept<\/p><\/div>\n<h2>Color Extraction<\/h2>\n<p>The color extraction algorithm that we used was jointly developed by Pavel and myself through several iterations (and I should note is a work in progress). Our goal was to get as close as possible to what a human would pick as the primary set of colors they see in a given photo. This isn\u2019t as easy as it might seem at first. A simple brute force approach of dividing an image into an <em>m x n<\/em> grid and taking the average of all the pixels within each grid element can often \u2018average out\u2019 intense colors.<\/p>\n<p>In the end, our approach is pretty simple, but effective:<\/p>\n<p><strong><em>Step 1.<\/em><\/strong> Sample the colors of individual pixels at regular, fairly granular intervals, but large enough to perform relatively fast.<\/p>\n<p><strong><em>Step 2.<\/em><\/strong> Rank colors by area. \u00a0Humans are good at pattern recognition, and one of the primary ways we see color in images is by collapsing similar colors into essentially one color, so that instead of seeing hundreds of greys that make up a rock, we see an average flat grey. To accomplish this, we used a delta that would effectively group a set of similar colors together and used this to calculate and rank the colors according to greatest area. This delta was arrived at through trial and error on a number of images that gave the best average performance.<\/p>\n<p><strong><em>Step 3.<\/em><\/strong> Rank colors by intensity. \u2018Intensity\u2019 in this case is just a term we used to describe a particular combination of brightness (or lack of) and saturation. This would, for example, ensure that if there were small areas of very intense color, such as a tiny flower in a field of green foliage, it would get selected, just as a human would. These colors can be missed by following a brute force average approach as well as ranking by area.<\/p>\n<p><em>Note:\u00a0 Step 3 is not yet fully implemented.<\/em><\/p>\n<h2>Patterns<\/h2>\n<p>To begin with, I created four patterns (generators) based on the new visual language that Pavel implemented. Initially these were hard-coded and and drawn to Canvas, but they have since been converted to rendering with SVG. While we have a very small set at the moment, the goal is to be able to rapidly expand this set of imagery and eventually open it up to contributors.<\/p>\n<h2>The Tool<\/h2>\n<div id=\"attachment_3957\" style=\"width: 970px\" class=\"wp-caption alignleft\"><a href=\"http:\/\/firefoxos-mozilla.sapp.io\/\" target=\"_blank\"><img aria-describedby=\"caption-attachment-3957\" decoding=\"async\" loading=\"lazy\" class=\"wp-image-3957 size-full\" src=\"https:\/\/blog.mozilla.org\/ux\/files\/2015\/12\/2-9601.png\" alt=\"Firefox OS Customization Demo\" width=\"960\" height=\"960\" srcset=\"https:\/\/blog.mozilla.org\/ux\/files\/2015\/12\/2-9601.png 960w, https:\/\/blog.mozilla.org\/ux\/files\/2015\/12\/2-9601-160x160.png 160w, https:\/\/blog.mozilla.org\/ux\/files\/2015\/12\/2-9601-252x252.png 252w, https:\/\/blog.mozilla.org\/ux\/files\/2015\/12\/2-9601-600x600.png 600w\" sizes=\"(max-width: 960px) 100vw, 960px\" \/><\/a><p id=\"caption-attachment-3957\" class=\"wp-caption-text\">Firefox OS Customization Demo<\/p><\/div>\n<p>The tool in its\u2019 current form can be found at <a href=\"http:\/\/firefoxos-mozilla.sapp.io\/\">http:\/\/firefoxos-mozilla.sapp.io\/<\/a><\/p>\n<p><em>Try it out for yourself!<\/em><\/p>\n<p><strong><em>Step 1. <\/em><\/strong>Feed it an image by selecting the URL field at the top of the page and enter a URL link to any image on the web. Some images that we have used to develop this tool are listed below.<\/p>\n<blockquote><p>http:\/\/firefoxos-mozilla.sapp.io\/wallpapers\/PH_CalmDock@2x.jpg<\/p>\n<p>http:\/\/firefoxos-mozilla.sapp.io\/wallpapers\/PH_Hills@2x.jpg<\/p>\n<p>http:\/\/firefoxos-mozilla.sapp.io\/wallpapers\/PH_Leaves@2x.jpg<\/p>\n<p>http:\/\/firefoxos-mozilla.sapp.io\/wallpapers\/PH_Orange@2x.jpg<\/p>\n<p>http:\/\/firefoxos-mozilla.sapp.io\/wallpapers\/PH_PurpleFlower@2x.jpg<\/p>\n<p>http:\/\/firefoxos-mozilla.sapp.io\/wallpapers\/PH_RollingHills@2x.jpg<\/p>\n<p>http:\/\/firefoxos-mozilla.sapp.io\/wallpapers\/PH_Shore@2x.jpg<\/p>\n<p>http:\/\/firefoxos-mozilla.sapp.io\/wallpapers\/PH_Snail@2x.jpg<\/p>\n<p>http:\/\/firefoxos-mozilla.sapp.io\/wallpapers\/PH_SurrealGrass@2x.jpg<\/p>\n<p>http:\/\/firefoxos-mozilla.sapp.io\/wallpapers\/PH_Towers@2x.jpg<\/p>\n<p>http:\/\/firefoxos-mozilla.sapp.io\/wallpapers\/PH_Tree@2x.jpg<\/p>\n<p>http:\/\/firefoxos-mozilla.sapp.io\/wallpapers\/PH_TreeForest@2x.jpg<\/p>\n<p>http:\/\/firefoxos-mozilla.sapp.io\/wallpapers\/PH_Wheat@2x.jpg<\/p>\n<p>http:\/\/firefoxos-mozilla.sapp.io\/wallpapers\/PH_WhiteFlower@2x.jpg<\/p><\/blockquote>\n<p><strong><em>Step 2. <\/em><\/strong>Select a generator (or pattern).<\/p>\n<p><strong><em>Step 3. <\/em><\/strong>Modify the colors by selecting any two colors you wish from the extracted palette to create your own image.<\/p>\n<p><strong><em>Step 4. <\/em><\/strong>Download the image by clicking on the download link. Currently, only 720&#215;1280 images are available, which fit the <em>Sony Z3C<\/em> (our Foxfooding device), but we will be adding support for other screens in the future.<\/p>\n<h2>Next Steps<\/h2>\n<p>While we\u2019ve taken a good first step toward a simple but effective customization tool for Firefox OS, there are a number of things we want to do with it before it\u2019s truly useful. The next steps include converting it to a responsive web app, auto-detecting device screen size, adding new patterns and improving the color extraction algorithm.<\/p>\n<p><em>Stay tuned!<\/em><\/p>\n<p><strong>Credits<\/strong><\/p>\n<p>Developer: Pavel Ivanov<\/p>\n<p>Designer: Peter La<\/p>\n<p>Photography: Javier Pardina (<a href=\"http:\/\/pardina.co\/\">http:\/\/pardina.co\/<\/a>)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview Earlier this year, I had the privilege of working on concepting the future of Firefox OS visual design with a small team. As part of that exploration, I collaborated &hellip; <a class=\"go\" href=\"https:\/\/blog.mozilla.org\/ux\/2015\/12\/firefox-os-customization-concept\/\">Read more<\/a><\/p>\n","protected":false},"author":144,"featured_media":3956,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24660,1,9577,9600],"tags":[],"coauthors":[306191],"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/ux\/wp-json\/wp\/v2\/posts\/3953"}],"collection":[{"href":"https:\/\/blog.mozilla.org\/ux\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mozilla.org\/ux\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/ux\/wp-json\/wp\/v2\/users\/144"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/ux\/wp-json\/wp\/v2\/comments?post=3953"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/ux\/wp-json\/wp\/v2\/posts\/3953\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/ux\/wp-json\/wp\/v2\/media\/3956"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/ux\/wp-json\/wp\/v2\/media?parent=3953"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/ux\/wp-json\/wp\/v2\/categories?post=3953"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/ux\/wp-json\/wp\/v2\/tags?post=3953"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blog.mozilla.org\/ux\/wp-json\/wp\/v2\/coauthors?post=3953"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}