Andrew Kensler
About Archive Topics Feed

Andrew Kensler’s Blog

A 54-color Palette

Sep 19, 2016

I recently received an e-mail asking if I could run my palette generator to produce a 54-color palette. This is the same number of colors available on the old NES console (though it couldn’t do them all it once) and the person was curious how a palette from my program would compare. I’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’s what my program came up with.

Read more…

Mapping Pixel Art Palettes

May 27, 2016

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 laid out on a grid 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’ve come up with an interesting alternative to these crossword-style layouts.

Read more…

Pixel Art Palettes for Free

May 6, 2016

Ever since I discovered DawnBringer’s 16-color and 32-color palettes and later Arne’s, I’ve been thinking about what makes a good small but general-purpose palette (DawnBringer’s palettes are pretty neat, but they’re a bit desaturated and lacking in purples for my taste – you couldn’t do Monkey Island 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.

Read more…

Business Card Ray Tracer

Jan 12, 2016

Back when I was in grad school I got inspired by Paul Heckbert’s business card ray tracer challenge and wrote my own version as a way to procrastinate from working on my thesis. A few years ago this was found by Fabien Sanglard who wrote a nice analysis of it which went viral for a bit. Recently, I was going through some old files and found the expanded version of it that I’d originally started with.

Read more…

Converting Color Depth

Dec 19, 2015

Recently I wrote a program to perform image processing on a PNG image. Given that the input represented color in each channel with an unsigned byte and I wanted to process it as a floating point value in the 0.0 to 1.0 range, I wrote the code to divide by 255.0 on input and then multiply by 255.0 and truncate on output. This mostly works and seems to be the usual approach that people take. I’ve done it many times before but it’s always left me a bit uneasy. Is there a better way? I think there is.

Read more…

Luculent 2.0.0

Oct 16, 2015

Recently, I’ve been working on a major update to my programming font family, Luculent. I’m pleased to announce that as of last week, I released v2.0.0. This version adds support for 232 new codepoints, bringing it up to full coverage of the Adobe Latin 3 a.k.a., “Pro” character set. I also made numerous tweaks to the existing characters.

Read more…

Building Up Perlin Noise

Apr 21, 2015

For my inaugural post, I’d like to discuss Perlin noise. There are a number of explanations of Ken Perlin’s classic noise function, and most tend to lean heavily on viewing it as a weighted average of gradients, but I don’t think this is really the best way to get a constructive intuition for how it works. Perlin once mentioned that, “In fact, the noise function can be viewed as the surflet decomposition of a random density function sampled at a rectangular grid.” Though cryptic, I believe that this is the key to a far more useful understanding of Perlin noise. This post will be partly an explorable explanation of that idea and will show how to build up the noise function step-by-step.

Read more…