Coder Social home page Coder Social logo

quick-ti-cropper's Introduction

quick-ti-cropper

Quick manual cropping utility to grab 1:1 ratio sections from a folder of images

cropper.py

requirements

pip install opencv-python

Reading Video files requires ffmpeg.

usage

Pass a folder of images or videos, or single files as a prameter:

cropper.py [OptionalArgs] Z:\\somefolder\\somewhere

cropper.py [OptionalArgs] Z:\\somefolder\\somewhere\\test.png

cropper.py [OptionalArgs] Z:\\somefolder\\somewhere\\test.mp4

or to shuffle: cropper.py shuffle Z:\\somefolder\\somewhere

or to shuffle multiple folders: cropper.py shuffle Z:\\somefolder\\somewhere Z:\\someotherfolder\\somewhere

Pass a folder of images as a prameter:

cropper.py [OptionalArgs] Z:\somefolder\somewhere

Keys:

  • Right Click or Space for next image.
  • Mousewheel for resizing the box, Shift tot resize faster
  • Left Click to capture the hilighted square
  • Left Click and Drag to evenly spread a line of crops.
  • Ctrl and Mousewheel Change the overlap of crops when dragging.
  • B Skip to the next video during video frame cropping.
  • A and D to go back and forwards in frame history
  • R to rotate the image clockwise.

Optional Args:

General options:

  • SHUFFLE - Shuffle Images.
  • ONECLICK - Jump to next image on every click.
  • LARGESTFIRST - Sort files by size, largest to smallest.
  • MAXCROP - Initialize on each image with the largest possible crop size.
  • DARKENBG - Darken the unselected areas of the image in preview.
  • WHOLEFRAME - don't crop, take the whole frame
  • SLIDESHOW_TIMEOUT - timeout to skip to next image automatically
  • SKIPTXT - Do not create caption .txt files
  • NOSCALE - Do not scale final images down to TARGET_SIZExTARGET_SIZE
  • NOIMAGES - Skip display of image files.
  • NOVIDEO - Skip display of video frames.
  • MAX_FILE_SIZE=N - Do not load files over N MB in size.
  • TARGET_SIZE=N - Set the target dimension in pixels (Default 512)
  • OUTDIR=DIR - Output to a directory called DIR ALLOW_SMALLER_CROP - Allow crops smaller than TARGET_SIZExTARGET_SIZE

Video Options:

  • IFRAME_GAP=N - When cropping video frames, wait at least N seconds between Key frames (Default 10).
  • VIDEO_START=N - When cropping video frames, Sart this many seconds or HH:MM:SS into the video

Cache Limits:

  • FRAME_FWD_CACHE=N - The maximum number of bytes to use for a forward frame cache when cropping video frames (Default 1GB).
  • FRAME_HIST_CACHE=N - The maximum number of bytes to use to keep images in history so they can be skipped back to (Default 1GB).

images are saved into .\outdir\

image

image

getframes.py

requirements

ffmpeg

usage

Pass one or more video files a parameter:

getframes.py Z:\\somefolder\\video1.mp4

will extract a frame once every 60 seconds. and place it in the '.\frames' directory

quick-ti-cropper's People

Contributors

dfaker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

bmaltais

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.