Code Monkey home page Code Monkey logo

magick's Introduction

Magick

A golang wrapper for ImageMagick or GraphicsMagick command line.

Requirements

ImageMagick or GraphicsMagick command-line tool has to be installed. You can check if you have it installed by running

$ convert -version
Version: ImageMagick 7.0.8-8 Q16 x86_64 2018-08-06 https://www.imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: https://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules
Delegates (built-in): bzlib fontconfig freetype jng jpeg ltdl lzma png tiff xml zlib

Installation

$ go get -u -v github.com/tnclong/magick

Usage

Let's see a basic example of resizing an gif image.

package main

import (
	"os"

	"github.com/tnclong/magick"
)

func main() {
	e := &magick.Engine{}
	resize := e.Convert("testdata/animation.gif", "-resize", "128x128>", "-verbose", "output.gif")
	resize.Stdout = os.Stdout
	resize.Stderr = os.Stderr
	err := resize.Run()
	if err != nil {
		panic(err)
	}
}

Doc

https://godoc.org/github.com/tnclong/magick

magick's People

Contributors

norcle avatar tnclong 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.