Coder Social home page Coder Social logo

picpunch's Introduction

picpunch

Buy Me A Coffee

Punches out a grid from an image and renders the results.

Requirements

  • Python >= 3.0

Installation

  1. Clone this repo
  2. Install pillow
    $ pip3 install pillow   

Usage

usage: picpunch.py [-h] [-b BORDER] -i INPUT -o OUTPUT -x PIECES_X -y PIECES_Y
                   [-p PREFIX] [-q QUALITY]

Punches out a grid from an image and renders the results

optional arguments:
  -h, --help            show this help message and exit
  -b BORDER, --border BORDER
                        cut off X% of the edges on every image (default: 0)
  -i INPUT, --input INPUT
                        input image
  -o OUTPUT, --output OUTPUT
                        output directory
  -x PIECES_X, --pieces-x PIECES_X
                        the amount of pieces in the x-axis
  -y PIECES_Y, --pieces-y PIECES_Y
                        the amount of pieces in the y-axis
  -p PREFIX, --prefix PREFIX
                        the output file prefix (default: output-XXXX-Y.ZZZ)
  -q QUALITY, --quality QUALITY
                        render quality in percent (default is 100 which means
                        lossless)

picpunch by Schluggi

Examples

Punch a 4x8 grid (lossless)

$ ./picpunch.py -i grid.jpeg -o /tmp/output -x 4 -y 8

Punch a 7x1 grid (400dpi) for web

$ ./picpunch.py -i grid.jpeg -o /tmp/output -x 7 -y 1 -q 30

Cut off only 5% of the edges (don't punch)

$ ./picpunch.py -i grid.jpeg -o /tmp/output -x 1 -y 1 -b 5

Credits

Created and maintained by Schluggi.

picpunch's People

Contributors

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