Code Monkey home page Code Monkey logo

conv_img's Introduction

conv_img

Yet another CLI utility to batch convert image files

This one depends on Pillow in Python.

Unlike other tools, conv_img preserves parts of the path, so we're not converting images in place (in the same directory as orginal) by default. Also note that we're acting on current directory:

conv_img DIR
# source/example.tif -> DIR/source/example.jpg

Install

git clone https://github.com/mokko/conv_img.git
cd conv_img
pip install .

Usage

conv_img [-h] [-a] [-f FILEMASK] [-l LIMIT] [-m MAX_SIZE] [-t TARGET_SUFFIX] [-v] dest_dir

positional arguments:
  dest_dir              destination directory to write to

options:
  -h, --help            show this help message and exit
  -a, --act             carry out conversion instead of just showing what would have been
  -f FILEMASK, --filemask FILEMASK
                        the filemask that identifies which images will be converted, defaults to '**/*.tif'
  -l LIMIT, --limit LIMIT
                        number of images after which script breaks off, defaults to -1 (no limit)
  -m MAX_SIZE, --max_size MAX_SIZE
                        max size of pixel, defaults to 6000 pixel for the longest size
  -t TARGET_SUFFIX, --target_suffix TARGET_SUFFIX
                        target image format, defaults to '.jpg'
  -v, --verbose         more verbose output

More Examples

conv_img DIR             # doesn't do any conversion yet, just show what would be done (using defaults)
conv_img -a DIR          # actually do it (using defaults) 
conv_img -f **/*.jpg DIR # the filemask for identifying image
conv_img -t .png DIR     # destination file format; note the period
conv_img -m 7000 DIR     # max size of longest side in pixels that bigger images are reduced
conv_img %               # put new image in original folder (aka convert in-place)

conv_img's People

Contributors

mokko avatar

Stargazers

 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.