ArtEvolver is a Java desktop application that creates Color Palette Puzzles from any image using a multithreaded genetic algorithm. It takes a source photograph and evolves a triangle mosaic approximation using only colors from a real-world paint palette — primarily the Sherwin-Williams catalog of 1,535+ named colors.
The result is a low-poly triangle art representation where every color corresponds to a real, purchasable paint. The evolution process runs in real-time, viewable in the built-in GUI or live-streamed to an audience.
- How It Works
- Features
- Getting Started
- Usage Guide
- Architecture Overview
- Palette System
- Configuration and Modes
- Video Export
- Contributing
- License
ArtEvolver overlays a fixed grid of isosceles triangles on a source image. The geometry never changes — only the color assigned to each triangle evolves over time. A population of candidate "drawings" competes through selection, crossover, and mutation until the mosaic converges on a close approximation of the original image.
- Load a source image (JPG or PNG) through the Swing GUI.
- The image is resized to match the triangle grid resolution.
- A grid of isosceles triangles is generated covering the entire image area.
- Each triangle is assigned a random color from the loaded paint palette.
- Multiple candidate drawings (the population) are created, each with a different random color arrangement.
- Multiple threads (8–32+) each run an independent
ImageEvolverinstance. - Each evolver selects parent drawings, produces children via crossover and mutation, and evaluates fitness.
- Fitness is computed as a pixel-by-pixel RGB comparison between the rendered triangles and the source image, scored from
0.0(no match) to1.0(perfect match). - Children that outscore their parents replace them in the population.
- The best image across all threads is displayed in the GUI in real-time.
- Frames can be auto-exported as PNG files for timelapse video generation via FFMPEG.
Unlike projects that evolve arbitrary RGB values, ArtEvolver constrains its palette to real manufacturer paint colors. Every triangle in the output maps to a named paint you could buy and apply. The primary palette is the Sherwin-Williams catalog (1,535 colors), but the system supports any palette defined in a simple text format.
The triangle grid is deterministic and fixed. Evolution operates exclusively on color assignment, making the problem analogous to a "paint by numbers" puzzle — given a fixed set of regions and a fixed set of paints, find the best color for each region.
- Sherwin-Williams — 1,535 named paint colors
- GBC Green — 4 shades (Game Boy Color aesthetic)
- Black & White — 2 colors
- Trilux — 12 pen colors
Triangle scale parameters control output resolution, from tiny thumbnails to 4K renders. Larger grids produce finer detail at the cost of longer convergence times.
8 to 32+ concurrent evolver threads run in parallel, each maintaining its own sub-population. The best result across all threads is tracked globally and displayed in the GUI.
Frames are exported as numbered PNG files at configurable intervals. These frames can be assembled into timelapse videos using FFMPEG, showing the image evolving from random noise to a recognizable mosaic.
The GUI refresh loop and frame export pipeline are designed with live-streaming in mind (Twitch, YouTube). Watch the evolution happen in real-time.
Pre-computed triangle pixel masks enable O(pixels_per_triangle) swap evaluation instead of full-image rendering + comparison. Achieves 50x faster iteration throughput (3.3 million raw swaps/sec) with exact score accuracy.
Greedy nearest-color assignment analyzes the source image at each triangle's region and assigns the best-matching unused palette color, producing a strong initial fitness before evolution begins.
Tournament-based selection combined with adaptive mutation decay gradually shifts the search from broad exploration to fine-tuning as fitness improves.
Meta-genetic algorithm that evolves GA parameters themselves. Velocity-aware composite ranking, multi-generational breeding with ancestry tracking, adaptive cutoff, multi-stage (geared) competitors, prehistoric mode with 8 progressive eras, promoted hall of fame, 21 preset strategies, autopilot mode, and real-time browser dashboard with REST API.
All user preferences (sidebar parameters, tournament settings, window positions, last loaded image)
are saved automatically on exit and restored on next launch via java.util.prefs.Preferences.
Help menu with Quick Start Guide and Parameter Reference. Context-sensitive tooltips on every control with suggested starting values. Dashboard help overlay for metric explanations.
Persistent disk cache stores resized source images in ~/.artevolver/cache/ so high-resolution
camera images (Canon EOS R5 45MP, R1 50MP, etc.) load near-instantly on subsequent opens.
In-memory cache for dashboard thumbnails with HTTP ETag support reduces CPU during auto-refresh.
Browser-based idle/clicker game — evolve a triangle mosaic one swap at a time. Drop or pick an
image, click to attempt random color swaps. Each click may improve fitness or miss; upgrades
make clicks smarter. Earn EP, buy 21 upgrades (click power, automation, intelligence, prestige),
unlock the Sample Atlas with real landscapes and iconic art, ascend for Golden Frame (GF), and
complete masterpieces at 85%+ fitness. Procedural sound engine, 75+ achievements, gallery of
completed images. Run clicker.bat / clicker.sh for one-click launch — no Java UI needed.
| Dependency | Version | Download |
|---|---|---|
| Java JDK | 21+ | Adoptium Temurin JDK 21 |
| Apache Maven | 3.6+ | Maven Downloads |
Windows (via winget):
winget install EclipseAdoptium.Temurin.21.JDKmacOS (via Homebrew):
brew install --cask temurin@21Linux (Debian/Ubuntu):
sudo apt install temurin-21-jdkOr download the installer for your platform directly from
Adoptium — pick the .msi (Windows),
.pkg (macOS), or .tar.gz (Linux) for JDK 21 LTS.
Windows (via winget):
winget install Apache.MavenmacOS (via Homebrew):
brew install mavenLinux (Debian/Ubuntu):
sudo apt install mavenOr download from maven.apache.org and add bin/ to your PATH.
java -version # Should show 21.x.x or higher
mvn -version # Should show 3.6.x or highergit clone https://github.com/Geomancer86/ArtEvolver.git
cd ArtEvolverThe fastest way to play. No Java UI knowledge needed — pick an image in your browser and start evolving.
Windows:
clicker.batLinux/Mac:
chmod +x clicker.sh
./clicker.shThis builds the project, starts the server, and opens the clicker game in your browser. Drop or pick an image, click to evolve.
For the complete ArtEvolver experience with tournaments, benchmarks, and all advanced features.
Windows:
start.batLinux/Mac:
chmod +x start.sh
./start.shThe script checks for Java and Maven, builds the project if needed, and launches the GUI.
Use --rebuild to force a clean build: start.bat --rebuild
mvn compileNote: If you encounter
MalformedInputExceptionduring a full build, palette.txtfiles have non-UTF-8 characters. This is handled automatically in v3.1+, but for older checkouts use:mvn compiler:compile -pl artevolver-core
Execute the main class to launch the GUI:
mvn exec:java -pl artevolver-core -Dexec.mainClass="com.rndmodgames.evolver.ArtEvolver"Or run com.rndmodgames.evolver.ArtEvolver directly from your IDE.
All tests run in headless mode (no Swing windows open). The test suite takes ~3 minutes.
# Run all tests (27 tests across 5 test classes)
mvn test -pl artevolver-core
# Run a specific test class
mvn test -pl artevolver-core -Dtest=BenchmarkTest
# Run a specific test method
mvn test -pl artevolver-core -Dtest=BenchmarkTest#lapSolverUnitTestTest classes:
| Class | Tests | Description |
|---|---|---|
ArtEvolverTest |
7 | Palette loading, shuffling, color operations |
ArtEvolverToolsTest |
5 | ImageEvolver creation and evolution |
BenchmarkTest |
9 | Delta fitness, LAP solver, permutation integrity, benchmarks |
CrossOverTest |
4 | CrossOver parameter management and evolution |
ImageEvolverTest |
2 | ImageEvolver instantiation and iteration counting |
- Launch the application. The Swing GUI window will appear.
- Click Load and select a source image (JPG or PNG).
- Click Start to begin the evolution process.
- Watch the triangle mosaic refine in real-time as the genetic algorithm iterates.
- The fitness score is tracked and displayed — higher values mean a closer match to the source image.
- If frame export is enabled, PNG files are written to disk automatically for later video assembly.
ArtEvolver is organized as a Maven multi-module project:
artevolver/ # v3.2.0
├── pom.xml # Parent POM
├── artevolver-core/ # Core evolution engine + GUI
│ └── src/main/java/com/rndmodgames/evolver/
│ ├── ArtEvolver.java # Swing GUI + threading orchestration
│ ├── ArtEvolverTools.java # Offline/test evolver factory
│ ├── AbstractEvolver.java # Fitness comparison (pixel-level RGB diff)
│ ├── ImageEvolver.java # Main evolution loop, rendering, mutations
│ ├── CrossOver.java # Crossover + mutation operators
│ ├── Triangle.java # Triangle polygon with assigned color
│ ├── TriangleList.java # Scored population member (drawing)
│ ├── Palette.java # Palette loader (parses text files)
│ ├── PalleteColor.java # Named color with RGB values
│ ├── DeltaFitnessEngine.java # O(pixels_per_tri) swap evaluation
│ ├── LAPSolver.java # Jonker-Volgenant optimal assignment
│ ├── EvolutionConfig.java # Parameter bundle with gene array
│ ├── EvolutionaryTournament.java # Meta-GA: ranking, breeding, lifecycle
│ ├── TournamentContestant.java # Single evolution run encapsulation
│ ├── TournamentManagerWindow.java # Tournament UI, autopilot, settings
│ ├── FitnessChartWindow.java # Real-time multi-series fitness chart
│ ├── FitnessTracker.java # Velocity/acceleration tracking
│ ├── DashboardServer.java # HTTP server + REST API + dashboard
│ ├── PrehistoricMode.java # Genesis mode (8 progressive eras)
│ ├── LineageNode.java # Ancestry tree for breeding
│ ├── SystemMonitor.java # JMX-based CPU/RAM/Disk monitoring
│ ├── SettingsManager.java # Persistent user preferences (java.util.prefs)
│ ├── ImageDiskCache.java # Persistent disk cache for resized source images
│ ├── ClickerState.java # Evolution Clicker game logic
│ ├── benchmark/
│ │ ├── BenchmarkLogger.java # Thread-safe CSV benchmark writer
│ │ └── BenchmarkRunner.java # Headless benchmark harness
│ └── render/
│ └── Renderer.java # PNG export with scaling
│ └── src/main/resources/
│ ├── dashboard.html # Browser dashboard (dark theme)
│ ├── palette4.txt # Sherwin-Williams (1,535 colors)
│ ├── sherwin.txt # Sherwin-Williams (original format)
│ ├── palette2.txt # Game Boy Color green (4 shades)
│ ├── palette3.txt # Black & White (2 colors)
│ └── trilux.txt # Trilux pens (12 colors)
├── artevolver-desktop/ # Desktop launcher module
└── README.md
ArtEvolver — Entry point. Builds the Swing UI, spawns evolver threads, and coordinates the global best-image display loop.
ImageEvolver — The core evolution loop running on each thread. Handles parent selection, child generation (via CrossOver), fitness evaluation (via AbstractEvolver), and population replacement. Also responsible for rendering the triangle mosaic to a BufferedImage using Java2D.
AbstractEvolver — Computes fitness by comparing each pixel of the rendered mosaic against the corresponding pixel of the source image. The RGB difference across all pixels is normalized to a 0.0–1.0 score.
DeltaFitnessEngine — Pre-computes which pixels belong to each triangle at initialization, then evaluates any color swap by computing only the affected pixels (~650 instead of 1.85M). Eliminates rendering and full-image comparison from the hot loop, achieving 50x throughput improvement.
CrossOver — Implements crossover (block exchange of triangle colors between two parents) and mutation (random color reassignment from the palette). Supports multiple mutation strategies: Grid, Random, Close (neighbor swap), and Random Grid.
Palette / PalleteColor — Loads palette definitions from text resource files into in-memory color lists used during initialization and mutation.
Renderer — Exports the current best mosaic as a scaled PNG file for frame capture and video generation.
EvolutionaryTournament — Meta-genetic algorithm that evolves GA parameters. Ranks contestants by a weighted blend of fitness, velocity, acceleration, and lineage. Culls the worst, breeds replacements via BLX-alpha crossover with Gaussian mutation, tracks best-ever configuration, and detects convergence.
TournamentManagerWindow — Full-featured Swing UI for managing the tournament: contestant table, detail panel, history log, autopilot controls, prehistoric mode, and evo settings dialog.
DashboardServer — Embedded HTTP server using com.sun.net.httpserver.HttpServer. Serves a browser-based real-time leaderboard with REST API endpoints for tournament state, image thumbnails, and full-resolution exports. Zero external dependencies.
FitnessChartWindow — Separate resizable JFrame with real-time multi-series fitness chart. Dark theme, gradient area fill, auto-scaling axes, peak indicator, color-coded legend, and per-series stats.
Palettes are defined in plain text files with one color per line:
ID ColorName R G B
Example (palette4.txt — Sherwin-Williams):
1 Darkest Green 15 16 15
2 Tricorn Black 17 14 16
3 Caviar 18 17 18
...
1535 High Reflective White 253 254 252
Fields are space-separated. The color name can contain spaces — the parser treats the last three tokens as R, G, B values and everything between the ID and the RGB values as the color name.
| File | Palette | Colors | Use Case |
|---|---|---|---|
palette4.txt |
Sherwin-Williams | 1,535 | Full-color realistic paint matching |
sherwin.txt |
Sherwin-Williams | varies | Original format variant |
palette2.txt |
GBC Green | 4 | Retro Game Boy Color aesthetic |
palette3.txt |
Black & White | 2 | High-contrast monochrome |
trilux.txt |
Trilux Pens | 12 | Pen-art style with limited colors |
To add your own palette, create a text file following the ID ColorName R G B format and place it in artevolver-core/src/main/resources/. Update the palette loading path in the source code to reference your new file.
ArtEvolver provides several preset configurations that balance speed and quality:
| Mode | Description |
|---|---|
QUICK_MODE |
Fast convergence, lower fidelity |
QUICK_EXTENDED_MODE |
Extended quick run with more iterations |
FASTEST_MODE |
Maximum speed, minimal quality checks |
QUALITY_MODE |
High fidelity, slower convergence |
QUALITY_MODE_STREAM |
Quality mode tuned for live-streaming frame rates |
| Parameter | Typical Range | Description |
|---|---|---|
| Population size | 2–8 per thread | Number of candidate drawings per evolver thread |
| Thread count | 8–32+ | Number of concurrent ImageEvolver instances |
EVOLVE_ITERATIONS |
2 | Mutation/evaluation cycles per batch |
| Mutation types | Grid, Random, Close, Random Grid | Strategies for color reassignment |
| Crossover | Block exchange | Swaps rectangular regions of triangle colors |
| Selection | Best-parent / Fitness-proportional | Parent selection strategy |
| Mutation decay | Adaptive | Mutation probability decreases as fitness improves |
Parameters can be adjusted in the source code to experiment with different evolutionary strategies.
ArtEvolver can export each frame of the evolution as a numbered PNG file. To assemble these frames into a timelapse video:
ffmpeg -framerate 30 -i frame_%06d.png -c:v libx264 -pix_fmt yuv420p output.mp4Adjust -framerate to control playback speed. Higher frame rates compress more generations into less video time.
Contributions are welcome. To get started:
- Fork the repository.
- Create a feature branch from
develop. - Make your changes with clear commit messages.
- Ensure the project builds successfully with
mvn compile. - Open a pull request against
develop.
Areas where contributions are especially appreciated:
- New palette files from other paint manufacturers
- Performance optimizations in the fitness evaluation loop
- Additional mutation and crossover strategies
- UI improvements and visualization features
- Documentation and examples
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
- GitHub: https://github.com/Geomancer86/ArtEvolver
- Twitter/X: @ArtEvolver