A script to tile images.
There are 100 face images in 100faces directory.
$ ./imgtile.py 100faces --size 16x16
$ ./imgtile.py 100faces --size 32x32 --limit 8 --space 3 --space-color gray
$ ./imgtile.py 100faces --size 32x32 --limit 8 --space 2 --tile-num 6
These sample images are taken from Labeled Faces in the Wild dataset.
$ git clone https://github.com/knjcode/imgtile.git
$ cd imgtile
$ pip install -r requirements.txt
Put images in a directory. Run this tool with directory name.
$ ./imgtile.py target_dir
Then, open output.png
-
Specify output filename
--output
(default 'output.png')$ ./imgtile.py target_dir --output result.jpg
-
Create images per subdirectory of target directory
--per-subdir
$ ./imgtile.py target_dir --per-subdir
-
Resize images
--size
(default '128x128')$ ./imgtile.py target_dir --size 64x64
-
Specify interpolation methods
--interpolation
(default INTER_LINEAR)$ ./imgtile.py target_dir --interpolation INTER_LANCOZ4
You can specify OpenCV interpolation methods: INTER_NEAREST, INTER_LINEAR, INTER_AREA, INTER_CUBIC, INTER_LANCZOS4, etc.
-
Keep aspect ratio
--keep-aspect
(default 'False')$ ./imgtile.py target_dir --keep-aspect
-
Set space between images
--space
(default 0px)$ ./imgtile.py target_dir --space 5
-
Set space color between images
--space-color
(default 'black')Specify a color by name (gray, for example)
$ ./imgtile.py target_dir --space 5 --space-color gray
Specify a color by three integer values between 0 and 255 without spaces (gray is 128,128,128, for example)
$ ./imgtile.py target_dir --space 5 --space-color 128,128,128
-
Specify horizontal tile number
--tile-num
$ ./imgtile.py target_dir --tile-num 64
-
Limit the number of tiling images
--limit
$ ./imgtile.py target_dir --limit 100
-
Display result image for iTerm2 (like a imgcat)
--imgcat
$ ./imgtile.py target_dir --imgcat
-
Display progress bar while loading
--progress
$ ./imgtile.py target_dir --progress
MIT