All Projects → esimov → Dithergo

esimov / Dithergo

Licence: mit
Various dithering algorithms implemented in Go

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Dithergo

Reproducible Image Denoising State Of The Art
Collection of popular and reproducible image denoising works.
Stars: ✭ 1,776 (+1287.5%)
Mutual labels:  image-processing
Typefont
The first open-source library that detects the font of a text in a image.
Stars: ✭ 1,575 (+1130.47%)
Mutual labels:  image-processing
Blur Detection
Some implementations of algorithms for blur detection in JPEGs
Stars: ✭ 125 (-2.34%)
Mutual labels:  image-processing
Dali
An image processor service
Stars: ✭ 119 (-7.03%)
Mutual labels:  image-processing
Whatsapp Like Photoeditor
A library module that tries to mimic whatsapp photo editor.
Stars: ✭ 121 (-5.47%)
Mutual labels:  image-processing
Jquery Filepond
🔌 A handy FilePond wrapper for jQuery
Stars: ✭ 124 (-3.12%)
Mutual labels:  image-processing
Serverless Docker Image Resize
Simple serverless image resize on-the-fly - Deploy with one command - Built with AWS Lambda and S3
Stars: ✭ 114 (-10.94%)
Mutual labels:  image-processing
Inpaint
✏️ Inpaint is a C++ library providing image inpainting algorithms
Stars: ✭ 126 (-1.56%)
Mutual labels:  image-processing
Gil
Boost.GIL - Generic Image Library | Requires C++11 since Boost 1.68
Stars: ✭ 122 (-4.69%)
Mutual labels:  image-processing
Unflattener
Make normal maps for 2D art
Stars: ✭ 125 (-2.34%)
Mutual labels:  image-processing
Steppy
Lightweight, Python library for fast and reproducible experimentation 🔬
Stars: ✭ 119 (-7.03%)
Mutual labels:  image-processing
Mgan
Masking GAN - Image attribute mask generation
Stars: ✭ 120 (-6.25%)
Mutual labels:  image-processing
Triangle
Convert images to computer generated art using delaunay triangulation.
Stars: ✭ 1,838 (+1335.94%)
Mutual labels:  image-processing
Tensorflow Recorder
TFRecorder makes it easy to create TensorFlow records (TFRecords) from Pandas DataFrames and CSVs files containing images or structured data.
Stars: ✭ 119 (-7.03%)
Mutual labels:  image-processing
Bitmap
C++ Bitmap Library
Stars: ✭ 125 (-2.34%)
Mutual labels:  image-processing
Overmix
Automatic anime screenshot stitching in high quality
Stars: ✭ 114 (-10.94%)
Mutual labels:  image-processing
Open Solution Salt Identification
Open solution to the TGS Salt Identification Challenge
Stars: ✭ 124 (-3.12%)
Mutual labels:  image-processing
Color Tracker
Color tracking with OpenCV
Stars: ✭ 128 (+0%)
Mutual labels:  image-processing
Lerc
Limited Error Raster Compression
Stars: ✭ 126 (-1.56%)
Mutual labels:  image-processing
Slic Python Implementation
🖼The python implementation to make superpixels by slic.
Stars: ✭ 125 (-2.34%)
Mutual labels:  image-processing

dithergo

CI Go Reference license

Dithergo is a simple Go library implementing various dithering algorithm to produce halftone images. It supports color and monochrome image outputs.

The library implements the following dithering methods: Floyd Steinberg, Atkinson, Burkes, Stucki, Sierra-2, Sierra-3, Sierra-Lite. All of these algorithms have something in common: they diffuse the error in two dimensions, but they always push the error forward, never backward.

We can represent this with the following diagram:

         X   7   5 
 3   5   7   5   3
 1   3   5   3   1

       (1/48)

where X represent the current pixel processed. The fraction at the bottom represents the divisor for the error. Above is the the Floyd-Steinberg dithering algorithm which can be transposed into the following Go code:

ditherers = []dither.Dither{
	dither.Dither{
		"FloydSteinberg",
		dither.Settings{
			[][]float32{
				[]float32{ 0.0, 0.0, 0.0, 7.0 / 48.0, 5.0 / 48.0 },
				[]float32{ 3.0 / 48.0, 5.0 / 48.0, 7.0 / 48.0, 5.0 / 48.0, 3.0 / 48.0 },
				[]float32{ 1.0 / 48.0, 3.0 / 48.0, 5.0 / 48.0, 3.0 / 48.0, 1.0 / 48.0 },
			},
			float32(multiplier),
		},
	},
}

You can plug in any dithering algorithm, so the library can be further extended.

Installation

$ go get -u -v github.com/esimov/dithergo

Running

Type go run cmd/main.go --help to check all the supported commands. The library supports the following commands:

Usage of commands:
  -e string
    	Generates & exports the color and greyscale mode halftone images. 
	Options: 'all', 'color', 'mono' (default "all")
  -em float
    	Error multiplier (default 1.18)
  -o string
    	Output folder
  -t	Option to export the tresholded image (default true)

You can run all of the supported dithering algorithms at once, or you can run a specific one from the cmd directory.

Results:

Input

The below images are generated with the default options using Michelangelo's David statue as sample image.

Color Monochrome
Atkinson Atkinson
Burkes Burkes
Floyd-Steinberg Floyd-Steinberg
Sierra-2 Sierra-2
Sierra-3 Sierra-3
Sierra-Lite Sierra-Lite
Stucki Stucki

Author

License

Copyright © 2018 Endre Simo

This software is distributed under the MIT license found in the LICENSE file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].