Skip to content

knjcode/imgtile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

imgtile

A script to tile images.

Examples

There are 100 face images in 100faces directory.

Tile 100 faces

$ ./imgtile.py 100faces --size 16x16

Tile 100 faces

Tile 8 faces with 3px gray spaces

$ ./imgtile.py 100faces --size 32x32 --limit 8 --space 3 --space-color gray

Tile 8 faces with 3px gray spaces

Tile 8 faces by 6 units with 2px spaces

$ ./imgtile.py 100faces --size 32x32 --limit 8 --space 2 --tile-num 6

Tile 8 faces by 6 units with 2px spaces

These sample images are taken from Labeled Faces in the Wild dataset.

Setup

$ git clone https://github.com/knjcode/imgtile.git
$ cd imgtile
$ pip install -r requirements.txt

Simple usage

Put images in a directory. Run this tool with directory name.

$ ./imgtile.py target_dir

Then, open output.png

Options

  • 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
    

License

MIT

About

A script to tile images

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages