atkinson

package module
v0.0.0-...-dacd7cb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2014 License: MIT Imports: 9 Imported by: 8

README

go-atkinson

Atkinson Dithering with Go.

lena.result.jpg

Example

package main

import (
	"github.com/koyachi/go-atkinson"
	"github.com/koyachi/go-lena"
	"fmt"
	"image/jpeg"
	"log"
	"os"
	"path/filepath"
)

func main() {
	fmt.Printf("processing...\n")
	img, err := lena.Image()
	if err != nil {
		log.Fatal(err)
	}
	img, err = atkinson.Dither(img)
	if err != nil {
		log.Fatal(err)
	}

	path, err := filepath.Abs("result.jpg")
	if err != nil {
		log.Fatal(err)
	}
	file, err := os.Create(path)
	if err != nil {
		log.Fatal(err)
	}
	err = jpeg.Encode(file, img, nil)
	if err != nil {
		log.Fatal(err)
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dither

func Dither(img image.Image) (result image.Image, err error)

func DitherFile

func DitherFile(path string) (result image.Image, err error)

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL