The photo mosaic algorithm is based on eflorit / mosaic-generator (php) and implements it on python language.
Besides, I also make some interesting features on this tool, I hope the PhotoMosaic-Artifact can help you to make some amazing & exciting photos :)
- Make the custom photographic mosaic image
- Support video material
- Support GUI tool
- Windows - Windows 10
- Mac OS - Mac OS 10.11+
- Linux - Ubuntu 16.04+
P.S.
The Pyinstaller builds is not fully static(issue), if your OS is not compatible with PhotoMosaic-Artifact, please just run it on source code instead of executble package.
- Pillow>=6.1.0
- numpy>=1.17.0
- opencv-python>=4.1.0.25
- Copy your material image files into material folder
- Follow below command line:
python photomosaic-core.py -i {input path} -r {int} -c {int} -m {material folder path} -s {float} -vs {int} -o {output file name} -g {int} -e {int} -t {float} -seed {int} [--no-thumbs]
or
photomosaic-core.exe -i sample.jpg -r 145 -c 100 -s 10
-i path to the original picture that shall be recreated
-r number of rows in output image
-c number of columns in output image
-m (default = ".\material") path to the material folder
-s (default = 1) output image size = input image size * scale
-vs (default = 5000) sampling video image interval (ms), only need be set if the material include video files
-o (optional) output file name
-g (default = 4) the min distance with same thumbnails image
-e (default = 27) enhance colors with original image (0~100%)
-f (default = "") use filter for creating thumbnails
-t (default = 0) set tolerance and seed args can generate different photo mosaic even the material images are the same
-seed (default = 0) random seed, using it on video image sampling and choose thumbs image
--no-thumbs (default = false) won't (re)generate thumbnails before creating mosaic
- The output image size (input image size * scale) must be divisible by row and col, the width must divisible by column; the height must divisible by row.
- The thumbnail image size = (input-image's width * scale / col, input-image's height * scale / row), if the aspect ratio of images in the material folder is different from the thumbnail, the image will be cropped to fit the aspect ratio of the thumbnail.
Demo sample1 (Org output img)
Demo sample2 (Org output img)
Demo sample3 (Org output img)
Demo sample4 (Org output img)
Demo sample5 (Org output img)
Demo sample6 (Org output img)
Demo sample7 (Org output img)
- eflorit / mosaic-generator - (https://github.com/eflorit/mosaic-generator)
This project is licensed under the terms of the MIT license.