Coder Social home page Coder Social logo

python-image-merger's Introduction

Python Image Merger

A Python image merging script.

Dependencies

This script uses Pillow for image manipulation. Please install Pillow before using this script.

Usage

python ImageMerger.py "--orientation=v" "--size=2" "--mode=RGB" "--fill-color=rgb(255,255,255)" "--optimize=t" "--quality=100" --verbose "--merge-path=test_files/output/test_2_vertical.png" "test_files/128/orange.png" "test_files/256/scarlet_red.png"
  • --orientation=[str]: Include if you want the merge to happen horizontally (h) or vertically (v). You can place any text here, but it will only check the first letter to mach either h or v, ignoring capitalization. If the first letter does not match either option, it will fall back to the default. Default is h.
  • --size=[int]: The number of images to fit along the width/height of the final image before changing row/column. Default is 0 (never changes the row/column).
  • --mode=[str]: A string defining the type and depth of the pixels in the final image. Refer to Pillow modes for all possible options. Default is RGBA.
  • fill-color=[str]: A string defining the final image's background color (only visible when images have mismatched sizes, or there are not enough images to fill the final row/column). Refer to Pillow color names for all possible options. Default is full transparency (rgba(0, 0, 0, 0) / #00000000).
  • --optimize=[str]: A string defining if you want the final image to have optimized encoder settings (t / y) or not (f / n). You can place any text here, but it will only check the first letter to mach either t, y, f, or n, ignoring capitalization. If the first letter does not match either option, it will fall back to the default. Default is to optimize (t / y).
  • --quality=[int]: An int defining the level of quality of the final image, ranging from 0 (worst) to 100 (best). Will only work on certain types of images, such as JPEG and TIFF. Default is 75.
  • --verbose: Include if you want the program to output to the console the value of all setup variables.
  • --merge-path=[str]: The path where to store the final merged image, relative to the current running directory. If no value is provided, it will output the merge to merge.png at the current working directory.

Every image path (relative to the current running directory) listed after these arguments will add the corresponding image in that order to the final image.

Output Examples

2 Images (Default)

2 Images (Horizontal)

2 Images (Vertical)

3 Images (Horizontal)

4 Images (Vertical 2)

9 Images (Horizontal 3)

python-image-merger's People

Contributors

sorcerystory 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.