GithubHelp home page GithubHelp logo

imclab / pycropper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bradmontgomery/pycropper

0.0 1.0 0.0 60 KB

Quick cropping for a large collection of images. Built with pygame.

License: MIT License

pycropper's Introduction

pyCropper

pyCropper is a simple program that allows quick cropping for a large collection of images. Built with pygame, it supports any file format that can be read/saved by pygame, and it has been tested with .jpg, .pgm, .gif, .png, .bmp, and .tif.

logo

Usage

Place the pycropper.py file in a directory with the images to be cropped, then run the following command:

python pycropper.py

All images in that directory will be loaded into a list and displayed sequentially. To crop an image, left-click to choose the top-left of the rectangle over the portion of the image to which you want to crop.

Left-click again to set bottom-right of the rectangle, and the image will immediately be cropped and saved. After the first left-click, you can right-click to cancel the rectangle and start over.

Keyboard Input

  • Left-click: (1) select top-left of cropping area, (2) select bottom-right, crop, and save image.
  • Right-click: cancel crop area selection.
  • Left-arrow/Up-arrow: Show previous image.
  • Right-arrow/Down-arrow: Show next image.
  • ESC: exit pycropper

License

This code is available under the MIT license.

History

This was originally written back in 2008, when I was playing around with image analysis tools (e.g. opencv). I needed to quickly crop hundreds of images after visually inspecting them, and tools like photoshop make this really time consuming. Anyway, this is the result. You can also read the original blog post.

pycropper's People

Contributors

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