# Smolpix: very tiny image generation toy

**URL:** <https://ziggit.dev/t/smolpix-very-tiny-image-generation-toy/15943>\
**Category:** Showcase\
**Tags:** zig-0-16, handmade\
**Created:** [June 5, 2026, 9:17pm UTC](https://ziggit.dev/t/smolpix-very-tiny-image-generation-toy/15943 "2026-06-05T21:17:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tgirod](https://ziggit.dev/user_avatar/ziggit.dev/tgirod/32/3744_2.png) [@tgirod](https://ziggit.dev/u/tgirod)\
**Post date:** [June 5, 2026, 9:17pm UTC](https://ziggit.dev/t/smolpix-very-tiny-image-generation-toy/15943/1 "2026-06-05T21:17:59Z")

</div>

# SMOLPIX

* * *

[https://codeberg.org/tgirod/smolpix](https://codeberg.org/tgirod/smolpix)

Smolpix is a toy application to generate animations with a very simple stack language - think shadertoy meets forth. The program generates an animation of 256 frames of size 256x256. each pixel is computed based on three parameters `(x,y,t)` and their combinations through various arithmetic operations and functions. The stack language manipulates onl `u8` and uses modulo operators, so using multiplication usually gives wild results!

This project is my playground to learn more about SIMD and performance in general, and to have an excuse to play with my computer. 🙂

There are probably many things I could improve in terms of usability (making the program not explode when your script is invalid) or performance (I could generate the frames in parallel).

The code is pretty much its own documentation right now, but I think it is pretty straightforward. Feel free to give me feedbacks!

### Supported Zig versions

version 0.16

PS: I’m so happy there is a “handmade” tag !

---

<div class="post-metadata">

**Author:** ![glitchcake](https://ziggit.dev/user_avatar/ziggit.dev/glitchcake/32/2361_2.png) [@glitchcake](https://ziggit.dev/u/glitchcake)\
**Post date:** [June 8, 2026, 1:21pm UTC](https://ziggit.dev/t/smolpix-very-tiny-image-generation-toy/15943/2 "2026-06-08T13:21:37Z")

</div>

This is super neat! I’ve been using raylib lately, and it’s a lot of fun

---

<div class="post-metadata">

**Author:** ![tgirod](https://ziggit.dev/user_avatar/ziggit.dev/tgirod/32/3744_2.png) [@tgirod](https://ziggit.dev/u/tgirod)\
**Post date:** [June 8, 2026, 1:53pm UTC](https://ziggit.dev/t/smolpix-very-tiny-image-generation-toy/15943/3 "2026-06-08T13:53:04Z")

</div>

@glitchcake thanks!

The latest version has seen massive performance improvements compared to the first naive version, thanks to computing pixels with SIMD instructions, and computing frames in parallel with the new Io interface.

However it doesn’t compile in ReleaseFast right now, but it seems to be linked to zigraylib. The linker error is beyond me right now.

---

<div class="post-metadata">

**Author:** ![pals](https://ziggit.dev/user_avatar/ziggit.dev/pals/32/8788_2.png) [@pals](https://ziggit.dev/u/pals)\
**Post date:** [June 9, 2026, 10:18pm UTC](https://ziggit.dev/t/smolpix-very-tiny-image-generation-toy/15943/4 "2026-06-09T22:18:54Z")

</div>

super cool, will this become a tool you will use in some scenario?

---

<div class="post-metadata">

**Author:** ![tgirod](https://ziggit.dev/user_avatar/ziggit.dev/tgirod/32/3744_2.png) [@tgirod](https://ziggit.dev/u/tgirod)\
**Post date:** [June 10, 2026, 6:19am UTC](https://ziggit.dev/t/smolpix-very-tiny-image-generation-toy/15943/5 "2026-06-10T06:19:38Z")

</div>

My original idea was to put this in an android app, and share the programs through the payload of a virtual BLE beacon (31 bytes), so it propagates like smallpox, hence the name of the project. 🙂

But honestly, I’m not sure I will go this far, because compsci is not my job anymore and I do that on the side just to have fun and to keep my programming muscle alive …

---

<div class="post-metadata">

**Author:** ![tgirod](https://ziggit.dev/user_avatar/ziggit.dev/tgirod/32/3744_2.png) [@tgirod](https://ziggit.dev/u/tgirod)\
**Post date:** [June 10, 2026, 7:37am UTC](https://ziggit.dev/t/smolpix-very-tiny-image-generation-toy/15943/6 "2026-06-10T07:37:38Z")

</div>

UPDATE: latest version gives more informations about available words and validate the program before executing it. much more usable!

---

<div class="post-metadata">

**Author:** ![tgirod](https://ziggit.dev/user_avatar/ziggit.dev/tgirod/32/3744_2.png) [@tgirod](https://ziggit.dev/u/tgirod)\
**Post date:** [June 14, 2026, 10:17am UTC](https://ziggit.dev/t/smolpix-very-tiny-image-generation-toy/15943/7 "2026-06-14T10:17:17Z")

</div>

latest commits add HSV to RGB conversion. It was an interesting challenge to modify the algorithm in order to represent floating values in range [0:1] with u8, and to make heavy use of saturating operators in order to vectorize some parts.

PS: I get nice rainbows but I think the hue phase is wrong, there are probably bugs somewhere …
