• Stars
    star
    256
  • Rank 159,219 (Top 4 %)
  • Language
    Go
  • License
    MIT License
  • Created about 7 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A fast, almost Gaussian Blur implementation in Go

stackblur-go

Go Reference build

Go port of Mario Klingemann's Stackblur algorithm.

Stackblur is a compromise between Gaussian blur and Box blur, but it creates much better looking blurs than Box blur and it is ~7x faster than Gaussian blur.

Comparing to the Javascript implementation the Go version is at least 50% faster (depending on the image size and blur radius), applied on the same image with the same bluring radius.

Benchmark

Radius Javascript Go
20 ~15ms ~7.4ms

Installation

First, install Go, set your GOPATH, and make sure $GOPATH/bin is on your PATH.

$ export GOPATH="$HOME/go"
$ export PATH="$PATH:$GOPATH/bin"

Next download the project and build the binary file.

$ go get -u -f github.com/esimov/stackblur-go
$ cd cmd && go build -o $GOPATH/bin/stackblur

CLI example

The provided CLI example supports the following flags:

$ stackblur --help

Usage of stackblur:
  -gif
    	Output Gif
  -in string
    	Source
  -out string
    	Destination
  -radius int
    	Radius (default 20)

The command below will generate the blurred version of the source image.

$ stackblur -in image/sample.png -out image/output.png -radius 10

The cli command supports a -gif flag, which if set as true it visualize the bluring process by outputting the result into a gif file.

API

The usage of the API is very simple: you need to expose an image file and a blur radius to the Process function. This will return the blurred version of the original image.

stackblur.Process(src, blurRadius)

Results

Original image Blurred image

License

This project is under the MIT License. See the LICENSE file for the full license text.

More Repositories

1

caire

Content aware image resize library
Go
10,356
star
2

pigo

Fast face detection, pupil/eyes localization and facial landmark points detection library in pure Go.
Go
4,386
star
3

triangle

Convert images to computer generated art using delaunay triangulation.
Go
2,038
star
4

diagram

CLI app to convert ASCII arts into hand drawn diagrams.
Go
835
star
5

dithergo

Various dithering algorithms implemented in Go
Go
167
star
6

forensic

Copy-move image forgery detection library.
Go
136
star
7

gobrot

Mandelbrot image renderer in Go
Go
105
star
8

gogu

A comprehensive, reusable and efficient concurrent-safe generics utility functions and data structures library.
Go
97
star
9

colorquant

Go library for color quantization and dithering
Go
85
star
10

legoizer

A tool to convert images to Lego bricks.
Go
80
star
11

ascii-fluid

Terminal based ASCII fluid simulation controlled by your webcam. 🌊
Go
66
star
12

colidr

Coherent Line Drawing implementation in Go.
Go
55
star
13

pigo-wasm-demos

Webassembly demos showcasing the Pigo face detection library.
Go
53
star
14

gifter

Gif image renderer running in terminal.
Go
44
star
15

gospline

Implementing b-spline curves in Go
Go
37
star
16

cloth-physics

Desktop application for cloth physics simulation using Gio GUI.
Go
37
star
17

triangle-app

Desktop application for Triangle.
JavaScript
35
star
18

pigo-face-tracking

Play games with your head. A face tracking application using the Pigo library.
Go
27
star
19

asciibrot

ASCII mandelbrot fractal running in terminal
Go
22
star
20

facemask

Overlay a mask over a person's face
Go
17
star
21

pigo-openfaas-faceblur

OpenFaaS faceblur function using the Pigo face detector library. (https://github.com/esimov/pigo)
Go
17
star
22

minecraft.js

Simplex noise based minecraft map generator
JavaScript
17
star
23

caire-openfaas

OpenFaaS function for Caire, the content aware image resize library. (https://github.com/esimov/caire)
Go
13
star
24

pigo-openfaas

OpenFaaS function for face detection using the Pigo library. (https://github.com/esimov/pigo)
Go
12
star
25

openfaas-coherent-line-drawing

Coherent Line Drawing OpenFaaS function based on https://github.com/esimov/colidr
Go
11
star
26

gomp

Alpha compositing operations and blending modes in Go.
Go
10
star
27

pigo-gocv-benchmark

Pigo vs GoCV face detection benchmark comparison
Go
4
star
28

simplexnoise.js

Javascript simplex noise implementation based on Stefan Gustavson paper: http://webstaff.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
JavaScript
3
star
29

homebrew-triangle

Brew formula for Triangle.
Ruby
2
star
30

go-arena

Testing and benchmarking the new experimental Go memory arenas.
Go
2
star
31

talks

Talks I have given
TeX
1
star
32

flash-experiments

Old Flash (ActionScript3) experiments
ActionScript
1
star