Skip to content

A Paint by Number generater and editor, that allows the user to input any image, and a photo of the paint palette they have, from which a Paint by Number image is created to perfectly match their paints

Notifications You must be signed in to change notification settings

Senacen/PaintByNumber

Repository files navigation

Paint By Number Generator

Examples at end

Generates a Paint By Number from an input image and a palette image. Allows control over smoothing and paint picking.

Notes

  • Starts by asking for input image and a palette image. Cancelling when first selecting images closes the application.
  • The larger the image, the longer processing will take. Turn off labelling until you want it, as calculating label positions every time is expensive.
  • The percentage under each palette square shows the percentage of the image that is made up by that paint, rounded to 1dp.
  • Label locations calculated using the Pole Of Inaccessibility of each region, from modifying the algorithm created by the Mapbox team (Explanation Blog, GitHub Repo)
  • Colour distance used in finding the closest palette colour to paint a pixel is calculated using the redmean formula

Redmean

to more accurately calculate the colour difference in sRGB space for the human eye than using the Euclidean distance

Euclidean distance

Mouse Controls:

Left click on the palette image to add that colour to the palette
Right click on a colour in the palette image, palette, or filled image to remove that colour from the palette
Drag with left click to select a rectangular area and blur the selected area on release

Keyboard Controls:

Space to smooth the filled image
L to toggle labelling
S to save current pbn image, filled image, and palette
M to magnify
R to revert smoothing changes
B to toggle black and white mode
N to choose new images
Up Arrow to increase the blur strength (blur kernel size) for smoothing
Down Arrow to decrease the blur strength (blur kernel size) for smoothing

Examples:

Unsmoothed

Filled Image
Paint By Number Image

Smoothed

Filled Image
Paint By Number Image
Palette

UI

User interface

About

A Paint by Number generater and editor, that allows the user to input any image, and a photo of the paint palette they have, from which a Paint by Number image is created to perfectly match their paints

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published