stackblur-go

A fast almost Gaussian Blur implementation in Go

Github星跟蹤圖

stackblur-go

GoDoc
Build Status

This is a Go port of Stackblur algorithm created by Mario Klingemann.

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), running 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 build the binary file.

$ go get -u github.com/esimov/stackblur-go/cmd

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 call

The API is very simple: you have to expose an image file and a blur radius to the Process function.

stackblur.Process(src, blurRadius)

Results, Original image, Blured image, :--:, :--:, , , ## License

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

主要指標

概覽
名稱與所有者esimov/stackblur-go
主編程語言Go
編程語言Go (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2017-09-01 07:51:05
推送於2025-04-30 13:40:19
最后一次提交2025-04-30 16:40:19
發布數5
最新版本名稱v1.1.1 (發布於 2025-04-28 16:04:57)
第一版名稱v1.0.0 (發布於 2017-09-28 14:42:26)
用户参与
星數260
關注者數6
派生數21
提交數72
已啟用問題?
問題數6
打開的問題數0
拉請求數3
打開的拉請求數0
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?