side by side of upscaling in the AGI engine

Upscaling The Sierras

If you played many games back in the mid-80s to 90s, you might remember the iconic graphics from Sierra’s Online Adventure Games. They were brightly colored (16 colors) and dynamic with some depth. To pay homage, [eviltrout] worked to upscale the images. Despite being rendered at 160×200 at 16 colors and then stretched, storing all those bitmaps even at only 4 bits per pixel would take all the storage available on the floppy disk. The engineers on the game decided instead to take a vector approach to a raster problem.

When [eviltrout] came through to try and upscale the backgrounds, he started by writing some code to extract the draw commands from the engine of the game, known as Adventure Game Interpreter (AGI). Comparing the vector commands to equivalent PNG versions with the best compression, the AGI vector versions were around half the size. Not bad for a couple of game developers in the 80s. Since it is all vector commands under the hood, it should be relatively simple to draw them at a much higher resolution. At least, that’s what he thought. The first issue was with flood fills. Since the canvas is larger, there are gaps between lines, and the flood escapes. A few approaches were taken, such as using a low-resolution reference and marching squares, but neither was satisfactory. Eventually, [eviltrout] expanded flood fills and used thicker lines. He also first rendered to a lower resolution and connected neighboring lines of the same color. Finally, he used ImageMagick to denoise white specs in the output.

We find the effect charming, but some might say you’re distorting art into what the artist never intended to be. But, as with all graphical enhancements, some artistic liberties are being taken without the original artist involved. The code is available on GitHub under an MIT license. Video after the break.

Continue reading “Upscaling The Sierras”

aemkei's xor patterns

Alien Art Drawn With Surprisingly Simple Math

Programmer [aemkei] Tweeted the formula (x ^ y) % 9 alongside code for more “alien art”. But how can a formula as simple as (x ^ y) % 9 result in a complex design? The combination of Bitwise XOR (^) and Modulo (%) generate a repeating pattern that’s still complex enough to satisfy the eye, and it’s ok if that doesn’t sound like an explanation. Bitwise operations are useful when working with memory and shift registers, but also worth learning if you want to drive lines or matrices of LEDs or interpret combinations of multiple switches, or in this case a great way to throw an interesting test pattern up on a new flip-dot display or low-res LED matrix. Are you into it? We are, so let’s jump in.

XOR Truth Table
0b00 0b01 0b10 0b11
0b00 0b00 0b01 0b10 0b11
0b01 0b01 0b00 0b11 0b10
0b10 0b10 0b11 0b00 0b01
0b11 0b11 0b10 0b01 0b00

Bitwise XOR compares each binary digit of the two inputs. The XOR returns a 1 when only one of the two digits is a 1, otherwise, it returns a zero for that position. Let’s say the coordinates were 3, 2. Converted to binary we have 0b11 and 0b10. From this truth table, we can see the most-significant digits are both 1, returning a 0, while only one of the least-significant digits is a 1, so the comparison returns a 1.

Moving onto the %, which is the Modulo operator has nothing to do with percentages. This operator divides two numbers and returns the remainder if any. Take 9 % 5. When dividing 9 by 5, 5 goes in once with a remainder of 4 so 9 % 5 = 4. Now our original formula from the top will draw a black box for every ninth number except that the bitwise XOR throws a wrench into that count, varying how often a number divisible by 9 appears and supplying the complexity necessary for these awesome patterns.

detail of aemkei's xor patterns

What are the most interesting designs can you create in a simple formula?

The Game Boy Camera, Or: How I Learned To Stop Worrying And Love The Pixels

Never underestimate the power of nostalgia. In an age when there are more megapixels stuffed in the sensor of a smartphone camera than the average computer display can even represent, why would jagged images from a 20-year-old grayscale camera with pixels numbering in the thousands still grab attention? Maybe what’s old is new again, and the coolness factor of novelty is something that can’t be quantified.

The surprise I had last Monday when I saw my Twitter notifications is maybe only second to the feeling I had when I was invited to become a Hackaday contributor. I’d made a very simple web app which mimics a Game Boy Camera using the camera from your phone or desktop, and it got picked up by people so much that I’m amazed my web host is still holding. Let’s look at why something seemingly so simple gained so much traction.

Continue reading “The Game Boy Camera, Or: How I Learned To Stop Worrying And Love The Pixels”

Paint The Rainbow With This Skittle-Dropping Pixel Art Robot

We hackers just can’t get enough of sorters for confections like Skittles and M&Ms, the latter clearly being the superior candy in terms of both sorting and snackability. Sorting isn’t just about taking a hopper of every color and making neat monochromatic piles, though. [JohnO3] noticed that all those colorful candies would make dandy pixel art, so he built a bot to build up images a Skittle at a time.

Dubbed the “Pixel8R” after the eight colors in a regulation bag of Skittles, the machine is a largish affair with hoppers for each color up top and a “canvas” below with Skittle-sized channels and a clear acrylic cover. The hoppers each have a rotating disc with a hole to meter a single Skittle at a time into a funnel which is connected to a tube that moves along the top of the canvas one column at a time. [JohnO3] has developed a software toolchain to go from image files to Skittles using GIMP and a Python script, and the image builds up a row at a time until 2,760 Skittle-pixels have been placed.

The downside: sorting the Skittles into the hoppers. [JohnO3] does this manually now, but we’d love to see a sorter like this one sitting up above the hoppers. Or, he could switch to M&Ms and order single color bags. But where’s the fun in that?

[via r/arduino]

Soda Can Lamp Pinpoints Your Interests

We’ve said it a million times before: 3D printing will expand your horizons. The more you print, the more you think about things you could print and new ways to use printing in the process of building projects. [AHNT] knows all about this phenomenon, because he thought of a way to use soda cans as canvases for customizable pixel art lamp shades.

[AHNT] designed a printable sleeve that fits perfectly over 250mL cans. It provides a sturdy grid for poking tiny holes with a medical needle, and can be reused indefinitely with any pattern imaginable. He created two different printable bases to illuminate the lamp: one is sized to hold a votive candle, and the other is made for an LED strip circuit with a rocker switch and 12 VDC barrel jack. We suppose it wouldn’t take much to use an RGB LED instead—a Trinket or a Gemma would surely fit in the base.

In the video after the break, [AHNT] talks about prepping the can by cleanly removing the lid, which he does by filing the top edge until the layers separate. He also discusses a few methods for removing the paint, and notes that sandblasting worked the best.

Don’t need another lamp? There’s a million things you can do with that empty soda can. You could make a theremin, or a battery, or even a treasure box. Cut it open and make a solder stencil. Or do something else entirely, and send us a tip.

Continue reading “Soda Can Lamp Pinpoints Your Interests”

3 Nerds + 2 Days = Little Big Pixel

Two days at a company sponsored hackathon? Sounds like fun to us! And productive too – the end result for [GuuzG] and two of his workmates from their company’s annual “w00tcamp” was this festive and versatile 16×16 pixel mega display.

From the sound of it, [GuuzG] and his mates at q42.com are not exactly hardware types, but they came up with a nice build nonetheless. Their design was based on 16 WS2812 LED strips for a 256 pixel display. An MDF frame was whipped up with cross-lap joints to form a square cell for each pixel. Painted white and topped with a frosted Plexiglass sheet, each RGB pixel has a soft, diffuse glow yet sharply defined borders. Powered by a pair of 5A DIN rail DC supplies and controlled by a Raspberry Pi, the finished display is very versatile – users can draw random pixel art, play the Game of Life, or just upload an image. [GuuzG] and company are planning to add Tetris, naturally, and maybe a webcam for fun.

We’ve seen lots of uses for the ubiquitous WS2812 LEDs, from clocks to Ambilight clones to ground-effect lighting for an electric skateboard. But if you’re in the mood for a display that doesn’t use LEDs, there’s always this multithreading display.

[via Reddit]