Git Product home page Git Product logo

rectselect's Introduction

rectselect

rectselect is a minimalist tool written in C++ to request rectangular selections from image files from a user for further processing in shell scripts. It may be used for semi-scripted image processing (cropping, annotating, ...).

Installation

Required dependencies: libgtkmm-3.0-dev

meson build
meson compile -C build/
meson install -C build/

Usage

rectselect <filename> <selection count>

Example (request 2 rectangular selections from example.jpg):

rectselect example.jpg 2

Selections can be created using two mouse clicks. The first click of a selection can be revised using the Escape key. Pressing Q will cancel the collection of further selections.

The resulting geometries are written to stdout, one by line. Example: 3724x1413+1702+762 (width, height, x-offset, y-offset).

Example usage in a shell script for cropping with ImageMagick:

#!/bin/sh

for F in *.JPG ; do
        echo "$F"
        GEOM_COUNT=0
        for G in $(rectselect "$F" 2) ; do
                convert "$F" -crop "$G" "out/$F-$GEOM_COUNT.jpg" &
                GEOM_COUNT=$(expr $GEOM_COUNT + 1)
        done

done

rectselect's People

Contributors

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