<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>Andrew Kensler's Blog</title>
<link>http://eastfarthing.com/blog/</link>
<description>Andrew Kensler's Blog</description>
<item>
<title><![CDATA[A Tour of the Tiny and Obfuscated Image Decoder]]></title>
<link>2020-09-14-decoder/index.html</link>
<pubDate>Mon, 14 Sep 2020 00:00:00 -0700</pubDate>
<description><![CDATA[<p>
I was mystified when I first came across the <a href="http://www.ioccc.org/2018/bellard/hint.html">&ldquo;Most Inflationary&rdquo;</a> winning
<a href="http://www.ioccc.org/2018/bellard/">entry</a> in the 2018 <a href="https://www.ioccc.org/index.html">IOCCC</a>.  Written by the <a href="https://bellard.org/">incredibly prolific</a> Fabrice
Bellard, this tiny program with just 4KB of source code emitted a
128&times;128 resolution version of the <a href="https://en.wikipedia.org/wiki/Lenna#Criticism">(in)famous</a> Lena test image.  Voodoo!
The IOCCC judges wrote &ldquo;We could understand some of the arithmetic but none
of the magic.&rdquo;  I was determined to figure out the magic and inspired by
<a href="https://fabiensanglard.net/">Fabien Sanglard</a> to try to write up how it works.
</p>
]]></description>
</item>
<item>
<title><![CDATA[More on Palettes]]></title>
<link>2020-08-10-palette/index.html</link>
<pubDate>Mon, 10 Aug 2020 00:00:00 -0700</pubDate>
<description><![CDATA[<p>
I was recently asked a pair of questions regarding palettes and my previous
posts on them.  First, I was asked about what a 48-color palette generated
by my <a href="../2016-05-06-palette/index.html">palette generator</a> algorithm would look like.  Secondly, a different
person asked me what my <a href="../2016-05-27-mapping/index.html">mapping</a> approach would make of the <a href="https://lospec.com/palette-list/pico-8-secret-palette">extended Pico-8
palette</a> with the 16 additional colors that have been added.
</p>
]]></description>
</item>
<item>
<title><![CDATA[Circles In Angles]]></title>
<link>2018-12-27-circle/index.html</link>
<pubDate>Thu, 27 Dec 2018 00:00:00 -0800</pubDate>
<description><![CDATA[<p>
Suppose that we have the 2D coordinates for three three ordered,
non-colinear points that together define an angle.  We also have the radius
for a circle inscribed in the angle.  How can we efficiently calculate the
coordinates where the center of the inscribed circle must be?
</p>
]]></description>
</item>
<item>
<title><![CDATA[Blending for Dithering]]></title>
<link>2017-09-23-dithering/index.html</link>
<pubDate>Sat, 23 Sep 2017 00:00:00 -0700</pubDate>
<description><![CDATA[<p>
What&rsquo;s the correct color space to compute color blends in for dithering for
display on a typical monitor?  At one point in my palette experiments I had
written some dithering code and naively assumed <a href="https://en.wikipedia.org/wiki/CIELAB">CIELAB</a> since that&rsquo;s
designed to be perceptually uniform.  But I had noticed that I was getting
some odd color casts.  Initially I&rsquo;d thought I&rsquo;d had a bug, but I
eventually realized that it was because CIELAB is the wrong color space.
<a href="https://en.wikipedia.org/wiki/SRGB#Specification_of_the_transformation">Linearized RGB with sRGB primaries</a> is the way to go.  Here&rsquo;s why.
</p>
]]></description>
</item>
<item>
<title><![CDATA[A 54-Color Palette]]></title>
<link>2016-09-19-palette/index.html</link>
<pubDate>Mon, 19 Sep 2016 00:00:00 -0700</pubDate>
<description><![CDATA[<p>
I recently received an e-mail asking if I could run my <a href="../2016-05-06-palette/index.html">palette generator</a> to
produce a 54-color palette.  This is the same number of colors available on
the old <a href="https://en.wikipedia.org/wiki/List_of_video_game_console_palettes#NES">NES console</a> (though it couldn&rsquo;t do them all it once) and the person
was curious how a palette from my program would compare.  I&rsquo;d always
figured that if I ran my program again for a larger palette it would be for
either 48 or 64 colors.  But sure, I can do 54.  Here&rsquo;s what my program
came up with.
</p>
]]></description>
</item>
<item>
<title><![CDATA[Mapping Pixel Art Palettes]]></title>
<link>2016-05-27-mapping/index.html</link>
<pubDate>Fri, 27 May 2016 00:00:00 -0700</pubDate>
<description><![CDATA[<p>
While researching pixel art palettes, one of the things I noticed was a lot
of discussion about color ramps.  As I read it, these are essentially
subsets of the colors in the palette that form distinct gradients and they
are most commonly shown <a href="http://orig01.deviantart.net/8cd5/f/2015/124/7/c/full_circle_color_ramps_by_cospixels-d8s6zob.png">laid out on a grid</a> interlocking with each other
like a crossword puzzle.  This seemed like a nice, qualitative way to
assess a palette and got me wondering how to map out a palette
automatically.  I think I&rsquo;ve come up with an interesting alternative to
these crossword-style layouts.
</p>
]]></description>
</item>
<item>
<title><![CDATA[Pixel Art Palettes for Free]]></title>
<link>2016-05-06-palette/index.html</link>
<pubDate>Fri, 06 May 2016 00:00:00 -0700</pubDate>
<description><![CDATA[<p>
Ever since I discovered DawnBringer&rsquo;s <a href="http://pixeljoint.com/forum/forum_posts.asp?TID=12795">16-color</a> and <a href="http://pixeljoint.com/forum/forum_posts.asp?TID=16247">32-color palettes</a> and
later <a href="http://androidarts.com/palette/16pal.htm">Arne&rsquo;s</a>, I&rsquo;ve been thinking about what makes a good small but
general-purpose palette (DawnBringer&rsquo;s palettes are pretty neat, but
they&rsquo;re a bit desaturated and lacking in purples for my taste &#x2013; you
couldn&rsquo;t do <a href="http://grumpygamer.com/stuff_and_things_and_monkey_island">Monkey Island</a> with them).  So far as I know, their palettes
were carefully selected by hand.  But I write code, so I took it as a
challenge to see if I could create a short program that would automatically
generate good palettes from scratch.  Here are the results of my
experimentation.
</p>
]]></description>
</item>
</channel>
</rss>
