42 Astoundingly Useful Scripts and Automations for the Macintosh

Hello World in Amber

A hello world too retro even for me.

Jerry Stratton, January 22, 2020

Hello World

I considered this for the cover, but the seventies amber was too over the top even for me.

  • ~/bin/asciiArt face.png --width 120 --palette "hello world" --sequence 0.8 --lighten 3.9 --save hello --bgcolor .995,.621,.037 --fgcolor 1,1,1

The amber I used is the color of many of the screens from the era. And many of those that were just white on black, you could buy screen overlays to make them be amber (or green). The excuse was that it was easier on the eyes, but I think the real reason is that amber and green made their screens look more like people thought a computer ought to look.

We still have that today: one of the most popular Terminal color schemes is green on black. It’s what I eventually went with for the Astounding Scripts cover.

But this amber ASCII art does highlight another feature of the ASCII art script in 42 Astoundingly Useful Scripts and Automations for the Macintosh: the ability to wash out an image, to brighten it, so as to highlight the areas with the most contrast. The original image had an off white fireplace and a window in the background. Lightening helped remove that, but it also helps when making an image like this to use a photo editor, such as GIMP or GraphicCoverter, to remove everything around the focus of the image. In the end I used the magic wand in GraphicConverter to get rid of the background. The lightening got rid of the lines on my face, highlighting the silly Incredibles Kleenex mask, hair, and shirt.

The argument --lighten 3.9 multiplies every color in the image by 3.9; the argument --sequence 0.8 tells the script to not only use the palette in order (so that it spells “hello world” instead of assumes that those letters are in order by density) but to cut off the sequence when the combined grayscale exceeds 0.8. If you look at the script itself, you’ll see that the default cutoff is 1.0; since there is no way for a greyscale to exceed 1.0 (colors range from 0.0 through 1.0), normally there is no cutoff at all.

Technically, there’s no need to have both a sequence cutoff and a lightening. Providing a low sequence cutoff should have the same effect as providing a high --lighten. I found it easier to conceive of a lightening of the image than a reduction of the cutoff, however. Partly this is because if the lightening brings the greyscale above 1, I have the script set it to 1, so that a non-sequential palette continues to work. A greyscale above 1 would fail, because the palette is normalized to range from 0.0 to 1.0. This also allows for inverting the greyscale value by subtracting it from 1.0; this would make no sense if greyscale values could exceed 1.0.

The asciiArt script becomes more versatile the more I use it. It is the rare script that continues to be as much fun to use as it was to write!

  1. <- Pointillist photos