All Projects → drake7707 → Paintbynumbersgenerator

drake7707 / Paintbynumbersgenerator

Licence: mit
Paint by numbers generator

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Paintbynumbersgenerator

Gopherkon
Go mascot image constructor. Create your cute own gopher.
Stars: ✭ 86 (+1.18%)
Mutual labels:  image, generator
Tui.image Editor
🍞🎨 Full-featured photo image editor using canvas. It is really easy, and it comes with great filters.
Stars: ✭ 4,761 (+5501.18%)
Mutual labels:  paint, image
Og Image
Open Graph Image as a Service - generate cards for Twitter, Facebook, Slack, etc
Stars: ✭ 2,706 (+3083.53%)
Mutual labels:  image, generator
Swift Video Generator
Stars: ✭ 517 (+508.24%)
Mutual labels:  image, generator
Php Initial Avatar Generator
Generate avatars with initials from user names.
Stars: ✭ 302 (+255.29%)
Mutual labels:  image, generator
Jspaint
🎨 Classic MS Paint, REVIVED + ✨Extras
Stars: ✭ 5,972 (+6925.88%)
Mutual labels:  paint, image
Packer Centos 6
This build has been moved - see README.md
Stars: ✭ 78 (-8.24%)
Mutual labels:  image
Touchable
Flutter library to add gestures and animations to each Shape you draw on your canvas in your CustomPainter
Stars: ✭ 82 (-3.53%)
Mutual labels:  paint
Summernote Image Attributes
Summernote plugin to edit image attributes
Stars: ✭ 78 (-8.24%)
Mutual labels:  image
Jsdoc To Markdown
Generate markdown documentation from jsdoc-annotated javascript
Stars: ✭ 1,199 (+1310.59%)
Mutual labels:  generator
Kirby Annotator
Kirby field for adding notes to images by pinning them to specific coordinates. Kirby 2 and 3.
Stars: ✭ 84 (-1.18%)
Mutual labels:  image
React Native Image Overlay
React Native's ImageBackground with overlay
Stars: ✭ 83 (-2.35%)
Mutual labels:  image
Dashed Border Generator
Custom Dashed Border | Online CSS Generator 🚀
Stars: ✭ 79 (-7.06%)
Mutual labels:  generator
Docker Nginx Image Proxy
on the fly image cropping with gravity, resize and compression microservice
Stars: ✭ 79 (-7.06%)
Mutual labels:  image
Deep Copy
Deep copy generator
Stars: ✭ 82 (-3.53%)
Mutual labels:  generator
Pixelate
Pixelate an image with canvas.
Stars: ✭ 78 (-8.24%)
Mutual labels:  image
Marlow
golang generator for type-safe sql api constructs
Stars: ✭ 83 (-2.35%)
Mutual labels:  generator
React Image Timeline
📆 An image-centric timeline component for React.js
Stars: ✭ 77 (-9.41%)
Mutual labels:  image
React Images Uploading
The simple images uploader applied Render Props pattern that allows you to fully control UI component and behaviors.
Stars: ✭ 80 (-5.88%)
Mutual labels:  image
Crud Generator
Laravel CRUD Generator
Stars: ✭ 1,244 (+1363.53%)
Mutual labels:  generator

Paint by numbers generator

Generate paint by number images (vectorized with SVG) from any input image.

Demo

Try it out here

CLI Version

The CLI version is a self contained node application that does the conversion from arguments, for example:

paint-by-numbers-generator-win.exe -i input.png -o output.svg

You can change the settings in settings.json or optionally specify a specific settings.json with the -c path_to_settings.json argument.

The settings contain mostly the same settings in the web version:

  • randomSeed: the random seed to choose the initial starting points of the k-means clustering algorithm. This ensures that the same results are generated each time.

  • kMeansNrOfClusters: the number of colors to quantize the image to

  • kMeansMinDeltaDifference: the threshold delta distance of the k-means clustering to reach before stopping. Having a bigger value will speed up the clustering but may yield suboptimal clusters. Default 1

  • kMeansClusteringColorSpace: the color space to apply clustering in

  • kMeansColorRestrictions: Specify which colors should be used. An array of rgb values (as number array) or names of colors (reference to color aliases). If no colors are specified no restrictions are applied. Useful if you only have a few colors of paint on hand.

  • colorAliases: map of key/values where the keys are the color names and the values are the rgb colors (as number array). You can use the color names in the color restrictions above. The names are also mentioned in the output json that tells you how much % of the area is of that specific color. "colorAliases": { "A1": [ 0, 0, 0 ], "A2": [ 255, 0, 0 ], "A3": [ 0, 255, 0 ], }

  • removeFacetsSmallerThanNrOfPoints: removes any facets that are smaller than the given amount of pixels. Lowering the value will create more detailed results but might be much harder to actually paint due to their size.

  • removeFacetsFromLargeToSmall (true/false): largest to smallest will prevent boundaries from warping the shapes because the smaller facets act as border anchorpoints but can be considerably slower

  • maximumNumberOfFacets: if there are more facets than the given maximum number, keep removing the smallest facets until the limit is reached

  • nrOfTimesToHalveBorderSegments: reducing the amount of points in a border segment (using haar wavelet reduction) will smooth out the quadratic curve more but at a loss of detail. A segment (shared border with a facet) will always retain its start and end point.

  • narrowPixelStripCleanupRuns: narrow pixel cleanup removes strips of single pixel rows, which would make some facets have some borders segments that are way too narrow to be useful. The small facet removal can introduce new narrow pixel strips, so this is repeated in a few iterative runs.

  • resizeImageIfTooLarge (true/false): if true and the input image is larger than the given dimensions then it will be resized to fit but will maintain its ratio.

  • resizeImageWidth: width restriction

  • resizeImageHeight: height restriction

There are also output profiles that you can define to output the result to svg, png, jpg with specific settings, for example:

  "outputProfiles": [
        {
            "name": "full",
            "svgShowLabels": true,
            "svgFillFacets": true,
            "svgShowBorders": true,
            "svgSizeMultiplier": 3,
            "svgFontSize": 50,
            "svgFontColor": "#333",
            "filetype": "png"
        },
        {
            "name": "bordersLabels",
            "svgShowLabels": true,
            "svgFillFacets": false,
            "svgShowBorders": true,
            "svgSizeMultiplier": 3,
            "svgFontSize": 50,
            "svgFontColor": "#333",
            "filetype": "svg"
        },
        {
            "name": "jpgtest",
            "svgShowLabels": false,
            "svgFillFacets": true,
            "svgShowBorders": false,
            "svgSizeMultiplier": 3,
            "svgFontSize": 50,
            "svgFontColor": "#333",
            "filetype": "jpg",
            "filetypeQuality": 80
        }
    ]

This defines 3 output profiles. The "full" profile shows labels, fills the facets and shows the borders with a 3x size multiplier, font size weight of 50, color of #333 and output to a png image. The bordersLabels profile outputs to a svg file without filling facets and jpgtest outputs to a jpg file with jpg quality setting of 80.

The CLI version also outputs a json file that gives more information about the palette, which colors are used and in what quantity, e.g.:

  ...
  {
    "areaPercentage": 0.20327615489130435,
    "color": [ 59, 36, 27 ],
    "frequency": 119689,
    "index": 0
  },
   ...

The CLI version is useful if you want to automate the process into your own scripts.

Screenshots

Screenshot

Screenshot

Example output

ExampleOutput

ExampleOutput2

Running locally

I used VSCode, which has built in typescript support. To debug it uses a tiny webserver to host the files on localhost.

To run do npm install to restore packages and then npm start to start the webserver

Compiling the cli version

Install pkg first if you don't have it yet npm install pkg -g. Then in the root folder run pkg .. This will generate the output for linux, windows and macos.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].