Skip to content

Build a photographic mosaic! Supports various RGB euclidean color difference algorithm

Notifications You must be signed in to change notification settings

weilueluo/Mosaic-Pics

Repository files navigation

🔳Mosaic-Pics

中文

sample image

  • For demostration purpose, this Image has 30% alpha blended with original, for raw output visits picture_output

Usage

> main.py

arguments:
  -src --source         the image to stimulate
  -s --size             the size of each pieces
  -d --dest             the images output folder
  -f --folder           the folder containing images used to stimulate the source

optional arguments:
  -m --method          the method used to compute difference of two colors,
                         default use euclidean (can be change in settings.py)
  -r --repeat           allow build with repeating images
  -fa --factor          result size compared to original size

  ---
  method currently supported
  ---
  euclidean              classic euclidean distance between colors
  weighted euclidean     euclidean but RGB fit to human perception: 0.3R, 0.59G, 0.11B
  weighted euclidean+    closer approx than weighted euclidean: 2R, 4G, 3B
  weighted euclidean++   closer approx than weighted euclidean, details see source
  all                    run all methods

  method source: https://en.wikipedia.org/wiki/Color_difference
  ps: use " to surround multiple words input

  ---
  relative speed (my machine)
  ---
  euclidean:             k
  weighted euclidean:    k+-(~5%)
  weighted euclidean+:   k+-(~5%)
  weighted euclidean++:  k+(~20%)

Note

  • On first run it will create a database in source folder, subsequent run with same database will be much faster for large database, see settings.py for more details
  • You should config settings.py before the first run on new database folder
  • This program only accept .jpg and .png files and does not search files recursively in the folder

About

Build a photographic mosaic! Supports various RGB euclidean color difference algorithm

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages