tilf

Single-executable pixel art editor that starts instantly with no accounts, no setup, and no internet required.

461stars
23forks
GNU GPLv3
Python

Tilf (Tiny Elf) is a free, open-source pixel art editor built with Python and PySide6 that lets creators draw sprites and icons without friction. There are no accounts, no email registrations, and no online platforms — just download the single executable, launch it, and start drawing. It runs natively on Windows, macOS, and GNU/Linux with essentially zero dependencies beyond what is bundled.

The editor targets compact pixel art and small 2D game assets rather than competing with full-featured tools like Aseprite. Core workflows are covered well: a set of essential drawing tools, 1–50x canvas zoom, undo/redo with 50-state history, drag-and-drop image loading, real-time live preview, and export to PNG (with optional transparency), JPEG, and BMP. Keyboard shortcuts cover all common operations.

Tilf is packaged as a single binary via PyInstaller, making it ideal for use in air-gapped environments, classrooms with no network access, or developers who want a lightweight asset editor without a heavyweight installation. The GPL v3 license ensures the source remains open for modification and redistribution.

What You Get

  • Six Core Drawing Tools with Keyboard Shortcuts — Pencil (B), Eraser (E), Fill bucket (G), Eyedropper (I), Rectangle (R), and Ellipse (C) tools with full mouse event handling and Alt-key override for secondary color use.
  • Canvas Zoom from 1x to 50x — Scroll the mouse wheel or use the status bar slider to zoom in and out; the pixel grid automatically appears when zoom reaches 4x cell size for precision alignment.
  • 50-State Undo/Redo History — Every stroke and canvas operation is pushed onto a stack capped at 50 states, letting you reverse mistakes without memory bloat on low-end machines.
  • Drag-and-Drop Image Loading — Drop any PNG, JPEG, or BMP file directly onto the canvas window to open it without using file menus, preserving the original dimensions and converting to ARGB32 format.
  • Movable Real-Time Preview Dock — A dockable side panel scales a live copy of your artwork in real time so you can see how a sprite looks at natural size while editing at high zoom.
  • PNG, JPEG, and BMP Export with Transparency Options — Save files with or without alpha channel; PNG supports full transparency, while JPEG and BMP exports automatically flatten against a white background.
  • Auto-Save Recovery on Close — When you close with unsaved changes, a timestamped PNG recovery file is written to a tilf_autosaves folder next to the executable before any dialog appears.
  • Shift Canvas 1px in Any Direction — A dedicated Shift canvas action moves all pixel content left, right, up, or down by one pixel, wrapping the edge in the secondary background color.

Common Use Cases

  • Creating sprites for retro indie games — An indie developer uses Tilf to design 16×16 pixel characters for a Game Boy-style platformer, exporting PNG with transparency directly for use in Godot or Unity.
  • Designing icons for Linux desktop apps — A developer building a custom GTK utility creates 32×32 app icons in Tilf without installing GIMP or any subscription design tool.
  • Offline pixel art in classroom settings — A teacher distributes the standalone Tilf executable to students in a computer lab with no internet access, enabling hands-on pixel art lessons with zero setup time.
  • Rapid prototyping of game UI elements — A solo game developer sketches tile assets and HUD icons during a commute using Tilf offline, then imports them directly into the game project.
  • Creating custom icons for embedded or retro systems — An embedded systems developer uses Tilf to create small bitmap icons for a microcontroller display, exporting BMP files compatible with low-level rendering code.

Under The Hood

Architecture Tilf follows a clean entry-point pattern where main.py handles Qt application initialization and injects a single AppState instance into the main window. AppState extends QObject and uses Qt’s typed Signal system as a reactive state bus, emitting signals for dirty state, color selection, file path changes, tool switches, and image modifications. Tool implementations follow a proper Strategy pattern via a BaseTool abstract class with three abstract mouse event methods, allowing Canvas to dispatch all mouse interactions to whatever tool is currently active without any conditional logic. A circular import between the canvas module and tool modules is resolved cleanly using Python’s TYPE_CHECKING guard for static analysis and deferred imports inside the tool factory method. The data flow is reactive and largely unidirectional: state mutations in AppState propagate outward through Qt signals to UI widgets and the canvas renderer.

Tech Stack Built entirely in Python 3 with PySide6 as the sole GUI framework, using Qt 6’s native widget system for cross-platform rendering on Windows, macOS, and GNU/Linux. Image data is stored and manipulated as Qt QImage objects in ARGB32 pixel format, with direct pixel-level writes via setPixelColor() for the pencil and eraser, and a stack-based flood fill algorithm for the bucket tool. UI layout and styling use Qt’s QSS stylesheet system bundled as a flat file. PyInstaller packages the entire application — Python runtime, PySide6 bindings, assets, and QSS — into a single distributable binary. A Makefile automates virtual environment setup, dependency installation, and PyInstaller invocation on macOS and Linux.

Code Quality No automated tests exist anywhere in the repository — the project is self-described by its author as built for learning and personal use, with the author acknowledging that code quality was not prioritized. Error handling is pragmatic: missing stylesheets and icons degrade gracefully with console warnings, file load failures show a Qt message box, and the autosave path catches broad exceptions to avoid crashing on exit. Type annotations are present and consistent across the codebase, using Optional, typed collections, and PySide6 types. No linter, formatter, or CI configuration is present. Inline code comments are pedagogical and abundant, particularly explaining the circular import resolution strategy, which adds meaningful value for contributors.

What Makes It Unique Tilf’s differentiation is deliberate simplicity rather than algorithmic novelty. In a landscape where pixel art tools either require accounts (Piskel), subscriptions (Aseprite on some platforms), or heavy installation, Tilf delivers a fully functional, GPL-licensed editor as a single standalone executable with no registration barrier. The checkerboard transparency background is implemented as a cached QPixmap tiled via Qt’s drawTiledPixmap() rather than redrawing individual rectangles on every paint event, a concrete performance choice for responsive rendering. Shape tools use a separate preview image layer that composites over the canvas during drag operations, giving real-time visual feedback without modifying the underlying pixel data until mouse release.

Self-Hosting

Tilf is released under the GNU General Public License version 3 (GPL-3.0). This means you can freely use, modify, and redistribute the software, including for commercial purposes. However, the GPL requires that any modified versions you distribute must also be released under the GPL-3.0 with source code available. For most self-hosting scenarios — deploying it in a classroom, distributing it within your organization, or bundling it in an internal toolchain — the GPL imposes no practical restrictions as long as you are not distributing a proprietary derivative externally.

The operational reality of running Tilf is minimal by design. There is no server, no database, no network service, and no background process. The entire application is a single executable that runs on the end user’s machine. Deployment is as simple as copying the binary. Updates require manually downloading a new release from GitHub and replacing the old file. There is no auto-update mechanism, no telemetry, and no persistent state beyond what the user explicitly saves.

There is no managed or SaaS version of Tilf, no paid tier, and no cloud alternative. What you trade off compared to tools like Piskel or Adobe Express is cloud-based file storage, collaboration features, and update automation. What you gain is complete offline capability, no account overhead, and zero recurring cost. Support is limited to GitHub issues and community contributions — there is no commercial support option, no SLA, and no enterprise tier. For teams that need collaborative pixel art workflows or managed access controls, Tilf is not the right fit; for individuals or small teams that want a fast, friction-free editor on any machine, it delivers exactly what it promises.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack

No spam. Unsubscribe anytime.

Join 750+ subscribers
No spam. Unsubscribe anytime.

Search