Giter Site home page Giter Site logo

imgconvert.sh's Introduction

Batch Image Converter

Convert all images inside a folder into another given format using convert from the imagemagick package.

Dependencies: imagemagick

Usage and Example

Usage:

    ./imgconvert.sh -s [PATH] -d [PATH] -i [EXTENSION] -o [EXTENSION] [EXTRAS]
    ./imgconvert.sh --source [PATH] --destination [PATH] --input [EXTENSION] --output [EXTENSION]

To convert all your jpg images inside your folder $HOME/Wallpaper to png and save them inside /tmp run:

    ./imgconvert.sh -s ~/Wallpaper -d /tmp -i jpg -o png

To convert only jpg images with a filename starting with box\* (escape the asterisk) and save in /tmp:

    ./imgconvert.sh -s ~/Wallpaper -n box\* -d /tmp -i jpg -o png

To convert all your png images inside your folder $HOME/icons to xbm while keeping transparency, you can add convert specific arguments/options at the end of the command like the following:

    ./imgconvert.sh -s ~/icons -d /tmp -i jpg -o png -background white -alpha Background

You can also use the variable $pic running inside imgconvert.sh, this is the filename of the current file being processed if you need it in your command:

    ./imgconvert.sh -s ~/icons -i png -o xbm -alpha extract -negate $pic

Which should produce a more accurate transparency into the xmb file.

For more information about convert arguments/options run: man convert

Arguments and Options

    -h, --help           show script usage
    -s, --source         source path of folder where images are stored
                         [optional] if not specified current dir will be selected
    -d, --destination    destination path for the converted images
                         [optional] if not specified source dir will be selected
    -i, --input          input image format to convert
    -o, --output         output image format to save as
    -n, --name           name filter for source files

You can set convert (imagemagick) arguments and options at the end of the command. For more information run: man convert

Screenshot

Screenshot

Created by Themistokle Benetatos (http://www.mrt-prodz.com)

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.