Terry-Mao / paint

Terry-Mao/paint is an image processing library based on ImageMagick for golang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Terry-Mao/paint

Terry-Mao/paint is an image processing library based on ImageMagick for golang.

Requeriments

ImageMagick's MagickWand development files are required.

# OSX
$ brew install imagemagick

# Arch Linux
$ sudo pacman -S extra/imagemagick

# Debian
$ sudo aptitude install libmagickwand-dev

Installation

Just pull Terry-Mao/paint from github using go get:

# download the code
$ go get github.com/Terry-Mao/paint

Usage

package main

import (
    "github.com/Terry-Mao/paint"
    "github.com/Terry-Mao/paint/wand"
)

func main() {
    wand.Genesis()
    defer wand.Terminus()
    w := wand.NewMagickWand()
    defer w.Destroy()

    if err := w.ReadImage("./examples/input/test2.jpg"); err != nil {
        t.Error(err)
    }

    if err := paint.Thumbnail(w, 302, 126); err != nil {
        t.Error(err)
    }

    if err := w.WriteImage("./examples/output/test2-thumbnail.jpg"); err != nil {
        t.Error(err)
    }

}

Documentation

Read the Terry-Mao/paint documentation from a terminal

$ go doc github.com/Terry-Mao/paint
$ go doc github.com/Terry-Mao/paint/magickwand

Alternatively, you can paint and paint/wand online.

About

Terry-Mao/paint is an image processing library based on ImageMagick for golang


Languages

Language:Go 100.0%