Giter VIP home page Giter VIP logo

rainbowcc's Introduction

rainbowcc

Rainbow Collage Creator

Create a beautiful square collage according to a color code. (PIL required)

Usage

Download helpers.py and rainbow.py modules, and (optional) get rainbow.jpeg and luminosity.png

First import Collage class from collageGen into your python script.

Collage(directory, color_coding, temp_directory="collage_temp")

(paths can be absolute or relative)

  • directory is the path to a folder containing all the images (it will scan just .jpg and .png images)
  • color_coding is the path to an image of a color bar (see rainbow.jpeg)
  • temp_directory (optional) is the path to a temporary directory that will be created and the removed in order to execute the algorithm

After you created an instace of Collage, use the make_square_collage(spp, size, output) method. It'll take a mandatory parameter (spp), which is the size per picture of the collage, and tow optional parameters: size (which is auto by default), and output, which is the name of the result (it will be saved in the current directory as a png file).

Example

from collageGen import Collage

collage = Collage("my_img_dir", "rainbow.jpeg")

collage.make_square_collage(500, "beautifulCollage")

  • The example will take any picture from "my_img_dir" directory and will output a square collage according to "rainbow.jpeg" in a filename called "beautifulCollage.png".
  • The size of every individual picture of the collage will be 500x500 (don't take care of aspect ratio, the algorithm crops the image before resizing it if it wasn't 1:1.
  • The size of the collage array (if not provided) is automatically decided by the method execution taking into account the square root of the number of images in the given directory.

rainbowcc's People

Contributors

chrischriscris avatar

Watchers

 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.