Git Product home page Git Product logo

photomosaic's Introduction

Requirements

Usage

Prepare your image pool

  1. Collect a ton of images (2000 is a good number) for your image pool and place them in a directory (e.g. tiles/). Make sure they are the same size and w/h ratio*.
  2. Run $ python create_image_pool.py tiles/ to create the tiles database.

* use check_images.py to "weed" out images with different ratios $ python check_images.py tiles_dir desired_width desired_height weeded_tiles_dir This will put all images not matching desired_width and desired_height into weeded_tiles_dir so you can fix them later on and re-add them into the image pool.

Creating the mosaic

After running create_image_pool.py, you can now create mosaics. $ python photomosaic.py [options] source_image.jpg output_image.jpg tiles_dir

options

  • -p RATIO: Ratio between the tile size and subdivisions of the image. Set to higher numbers for finer details. Use whole numbers only. e.g. A RATIO of 4 would place 4 tiles into 1 subdivision of the image. Default is 1.
  • -m METHOD, --method=METHOD: Traversing method. (inside-out or top-down) Determines where to start traversing the source image.
  • -r --repeat: Allow repeating of tiles
  • -n --norepeat: Do not allow repeating of tiles [default]
  • -t THRESHOLD, --threshold=THRESHOLD: Threshold value for comparing colors. Default is 0.
  • -v --verbose: Verbose output.
  • -x XSTART, --xStart=XSTART: X position of where to start matching. For inside-out method only.
  • -y YSTART, --yStart=YSTART: Y position of where to start matching. For inside-out method only.

Sample results and more info can be found on my website.

photomosaic's People

Contributors

john2x avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.