{"id":1728,"date":"2024-01-22T09:50:15","date_gmt":"2024-01-22T17:50:15","guid":{"rendered":"https:\/\/otherthings.com\/blog\/?p=1728"},"modified":"2024-08-12T21:59:04","modified_gmt":"2024-08-13T04:59:04","slug":"big-wet-pixels-3","status":"publish","type":"post","link":"https:\/\/otherthings.com\/blog\/2024\/01\/big-wet-pixels-3\/","title":{"rendered":"Big Wet Pixels 3"},"content":{"rendered":"\n<p><iframe loading=\"lazy\" title=\"vimeo-player\" src=\"https:\/\/player.vimeo.com\/video\/905246653?h=e5fdf27d12\" width=\"480\" height=\"480\" frameborder=\"0\" allowfullscreen=\"\"><\/iframe><br \/><br \/>Still exploring big wet pixels (originally inspired by the #genuary4 prompt) using my watercolor simulation in Unity. Now the pixels are actually pixels: given a random selection of pigments and paper, they try their best to match the color coming in through my webcam. Lovely glitches ensue.<br \/><br \/>To get this working, I had to go back and solve an old problem that&#8217;s bothered me for decades: given an arbitrary set of three pigments and paper, what combination of pigment densities will produce the closest match for any given RGB color?  This is non-trivial, because the gamut described by three Kubelka-Munk pigments is non-linear, not necessarily convex, and might even not be an embedding!  In our <a href=\"https:\/\/otherthings.com\/uw\/watercolor\/\" target=\"_blank\" rel=\"noreferrer noopener\">1997 paper<\/a> we addressed that problem in a really crude way, which I was never very happy with: quantize the pigment densities into bins, and find the nearest bin in RGB space using a 3d-tree search. So it gave me great satisfaction last weekend when I implemented a continuous solution, using gradient descent.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><a href=\"https:\/\/otherthings.com\/blog\/wp-content\/uploads\/2024\/01\/KMGamut-GradientDescent.gif\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"600\" src=\"https:\/\/otherthings.com\/blog\/wp-content\/uploads\/2024\/01\/KMGamut-GradientDescent.gif\" alt=\"An animated GIF showing a non-linear 3D color gamut in RGB space. A thin colored line shows the path taken by gradient descent from the middle of the gamut to reach the closest possible point to any given RGB color.\" class=\"wp-image-1731\" style=\"aspect-ratio:1;object-fit:cover\"\/><\/a><\/figure>\n\n\n\n<p><em>The curved RGB color gamut described by a trio of semi-opaque white, amber and green pigments on purple paper. The white sphere represents the RGB color we&#8217;d like to match. A smaller, colored sphere represents the closest approximation that can be produced within the color gamut.  A thin, meandering line shows the path taken from the middle of the gamut via gradient descent.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Still exploring big wet pixels (originally inspired by the #genuary4 prompt) using my watercolor simulation in Unity. Now the pixels are actually pixels: given a random selection of pigments and paper, they try their best to match the color coming in through my webcam. Lovely glitches ensue. To get this working, I had to go &hellip; <a href=\"https:\/\/otherthings.com\/blog\/2024\/01\/big-wet-pixels-3\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Big Wet Pixels 3<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,162,132,9,123,15,60],"tags":[242,236,222,117],"class_list":["post-1728","post","type-post","status-publish","format-standard","hentry","category-animation","category-art","category-effects","category-fun","category-graphics","category-npar","category-video","tag-bigwetpixels","tag-genuary","tag-simulation","tag-watercolor"],"_links":{"self":[{"href":"https:\/\/otherthings.com\/blog\/wp-json\/wp\/v2\/posts\/1728","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/otherthings.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/otherthings.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/otherthings.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/otherthings.com\/blog\/wp-json\/wp\/v2\/comments?post=1728"}],"version-history":[{"count":5,"href":"https:\/\/otherthings.com\/blog\/wp-json\/wp\/v2\/posts\/1728\/revisions"}],"predecessor-version":[{"id":1735,"href":"https:\/\/otherthings.com\/blog\/wp-json\/wp\/v2\/posts\/1728\/revisions\/1735"}],"wp:attachment":[{"href":"https:\/\/otherthings.com\/blog\/wp-json\/wp\/v2\/media?parent=1728"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/otherthings.com\/blog\/wp-json\/wp\/v2\/categories?post=1728"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/otherthings.com\/blog\/wp-json\/wp\/v2\/tags?post=1728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}