Small .NET tool for preparing images for an iDotMatrix interactive display.
This project takes source images, reduces them into pixel-art-friendly output, limits the palette, draws a visible grid, and also generates a color legend. It is useful when you want to turn normal artwork into something easier to show on a low-resolution LED matrix display such as the iDotMatrix.
It is part of my workflow for this display:
- device: iDotMatrix programmable LED display
- Python ecosystem/tooling:
idotmatrix - this app: image preparation and pixel-art conversion before sending artwork to the display
For each image found in the Images folder, the app:
- Loads the image
- Removes dark background areas using edge-aware background cleanup
- Applies some preprocessing for pixel art
- Downscales the image into a grid-based pixel-art version
- Reduces the palette to a small number of colors
- Generates a legend image with the detected palette
- Saves all generated files into the
Outputfolder
These values are currently hardcoded in Program.cs:
targetColors = 10maxSquares = 64
That means every image is converted to a version that tries to use around 10 colors and fit within a 64 x 64 logical pixel grid.
For an input image like Images\example.png, the tool produces files in Output\ similar to:
example_smartRemoveBackground.pngexample_preprocessForPixelArt.pngexample.jpgexample_legend.pngexample.png
The final image is the grid-based pixel art version intended for display preparation.
Sinapsa.PixelArtGenerator/Program.cs- app entry point, loops through imagesSinapsa.PixelArtGenerator/App.cs- small app wrapperSinapsa.PixelArtGenerator/Services/PixelArtGenerator.cs- main generation workflowSinapsa.PixelArtGenerator/Extensions/ImageExtensions.cs- background removal, preprocessing, downscalingSinapsa.PixelArtGenerator/Extensions/ImageLegendExtensions.cs- palette legend generationSinapsa.PixelArtGenerator/Services/KMeansColorQuantizer.cs- color quantization helper
- .NET 8 SDK
- Windows, macOS, or Linux capable of running .NET 8
Main libraries used:
SixLabors.ImageSharpSixLabors.ImageSharp.DrawingMicrosoft.Extensions.Hosting
From the repository root:
dotnet run --project .\Sinapsa.PixelArtGenerator\Sinapsa.PixelArtGenerator.csprojOr from inside the project folder:
dotnet run- Put one or more source images into
Sinapsa.PixelArtGenerator/Images - Run the app
- Check the generated results in
Output - Pick the version that looks best for your display
- Use your normal
idotmatrixworkflow to send that image to the device
- The app currently processes all files found in the
Imagesfolder. - The app creates the
Outputdirectory automatically if it does not exist. - It is designed as a simple personal utility, so the settings are intentionally minimal and currently live in code.
- A key is read at the end of execution, which keeps the console window open when running interactively.
Low-resolution displays look better when artwork is simplified first. This tool helps convert normal images into something that is much more suitable for an LED matrix by:
- reducing visual noise
- limiting color count
- enforcing a square grid look
- giving a quick legend of the chosen palette
- move settings to configuration or command-line arguments
- allow choosing grid size and color count per run
- add filtering by file type
- export directly in the best format for the iDotMatrix toolchain
- preview the final image before sending to the display
No license file is currently included in this repository.