Giter Club home page Giter Club logo

wizardry's Introduction

wizardry

Wizardry is a task-based library for GraphicsMagick / ImageMagick that focuses on simplicity and getting one thing done right: processing images.

Travis Status

Installation

Before installing the module, you will need either GraphicsMagick or ImageMagick installed. If you use homebrew, it can be even simpler, with either just brew install graphicsmagick or brew install imagemagick. GraphicsMagick is recommended, as wizardry uses GraphicsMagick by default. After one of them is installed, run:

npm install wizardry

Basic Usage

var wizardry = require('wizardry');
var task = require('./path/to/your/task.json')

// Easy as one line.
wizardry(['path/to/image.png'], task, callback);

Wizardry requires an array of image(s) to process. It expects that they are valid file paths.

Command line usage

wizardry -i path/to/image.png -t path/to/your/task.json

Task file

A task file in wizardry is a JavaScript object (a .json file works great) that defines each of the commands to be run on an image. They are run in the order listed. It also provides configuration, such as the amount of processes to run, the output directory, and which library to use. If a library is not specified, it will default to GraphicsMagick.

Example task file

{
    "commands": {
        "modulate": "115, 0, 100",
        "colorize": "7, 21, 50"
    },
    "processes": 10,
    "library": "imagemagick",
    "outputDirectory": "/foo/bar/folder"
}

Testing

npm test

wizardry's People

Contributors

remixz avatar

Stargazers

Ryan Rubush avatar Arun Wilson avatar Eugene Korzun avatar Brian Curliss avatar Linus Miller avatar Hsuching avatar  avatar Angus H. avatar Chris Watson avatar JT5D avatar Daniel Chicote avatar Marwan Hilmi avatar Mehdi Seifi avatar Peter Schmidler avatar  avatar Mark Cicoria avatar Erhan Gundogan avatar Edmundas Mišeikis avatar Aldo Mendez Reyes avatar Colin Wood avatar Witold Graca avatar Paulo Oliveira avatar Flavian Vasile avatar Zendy Wongso avatar SeHoon Park avatar Mike Plachta avatar Garrett Strauss avatar etowner avatar Guo Yu avatar  avatar Greg Palaci avatar Abhishek Das avatar Dom avatar James Wyse avatar Andrés Gottlieb avatar Wes Todd avatar Justin Sisley avatar Victor Ionescu avatar Gabriel Baciu avatar Stefaney Roberts avatar dann toliver avatar Andrew Sliwinski avatar  avatar Aaron Foltz avatar Jesse Dorsey avatar David Smith avatar Josh Hoff avatar Gilbert Bagaoisan avatar Tejesh Mehta avatar Randall A. Gordon avatar Austin avatar João Campos avatar  avatar Lyle Underwood avatar Mitch Anderson avatar Philipp Nehaev avatar Sami Kukkonen avatar Martin avatar Imran avatar Markus Tiefenbacher avatar Tino Butz avatar bzzz avatar 草依山 avatar Moses Yeung avatar Hiroki Tani avatar anton avatar Andy Davies avatar Tavi avatar Oli avatar Ernad Halilović avatar Pete Schaffner avatar Tarkus avatar Erick Patrick avatar Yuki Nishijima avatar Alan K Fadliawan avatar Mario Pietsch avatar Honk Tang avatar roadlabs avatar Jeff Jewiss avatar Eric Lawrence avatar Christopher Stumph avatar Jeremy Herrman avatar Gosha Spark avatar Garrett Wilson avatar Sal Rahman avatar Jonathan Puckey avatar Ahmad Varoqua avatar Yin Yee Lai avatar Adrian Ottiker avatar Tomislav Capan avatar Lars De Richter avatar Val Packett avatar Dan Palmer avatar Paul Connolley (connrs) avatar Sönke Kluth avatar Jacques Tardie avatar Michelle Tilley avatar 6 avatar Miha Hribar avatar  avatar

Watchers

Adam Murray avatar Ben L. avatar John Perkins avatar Daniel Dias avatar roadlabs avatar Jack Perkins avatar Ben Clemens avatar Zach Klein avatar Thomas avatar Andrew Sliwinski avatar Philippe Modard avatar James Cloos avatar  avatar Eliot Fowler avatar  avatar Lewis J Ellis avatar  avatar Maxime CONY avatar Tyler Thompson avatar diydeploy avatar  avatar Meagan Moore avatar  avatar Nazir Agah avatar Hartley Miller avatar Chalon Bridges avatar Heather Tompkins avatar Manoj avatar  avatar  avatar

wizardry's Issues

Wizardry doesn't call back with gm failure exit codes

wizardry([fullPath], task, function (err) {
  // err == undefined in case of either gm success or failure
});

Because exit code data from each task on the stack is never sent back by the function in queue.drain.

I would propose returning a structure like this:

[
  {image: 'imageName1', code: 0},
  {image: 'imageName2', code: 1, message: 'gm mogrify: No decode delegate for this image format (imageName2).'}
]

What do you think?

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.