showerglass

command module
v0.0.0-...-ad22f3f Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: MIT Imports: 5 Imported by: 0

README

⭐   the project to show your appreciation. :arrow_upper_right:

Showerglass

A soothing face filter where you can appreciate the beauty but not fully identify the person. Useful for social applications, blogging etc.

Features

  1. Resizing (Caire, NearestNeighbor, BiLinear, CatmullRom)
  2. Face detection
  3. Showerglass filter over only face (delaunay triangulation)

female face

Image credit: https://unsplash.com/photos/tCJ44OIqceU

Installation

go get -u github.com/rocketlaunchr/showerglass/core
import dataframe "github.com/rocketlaunchr/showerglass/core"

Usage

import	"image/jpeg"
import	"os"
import	"github.com/rocketlaunchr/showerglass/core"

f, err := os.Open("face.jpg")
if err != nil {
	log.Fatalf("Error opening the file: %v", err)
}
defer f.Close()

opts := showerglass.Options{
	NewHeight: 100.0,
	NewWidth:  100.0,
	ResizeAlg: showerglass.CatmullRom,
	TriangleConfig: func(QRank, area int, Q float32, h, w int) *showerglass.Processor {
		if QRank < 1 {
			// only modify first image
			return &showerglass.Processor{
				MaxPoints:  1500,
				BlurRadius: 4,
			}
		}
		return nil
	},
}

masked, _, err := showerglass.FaceMask(f, opts)
if err != nil {
	log.Fatalf("Error aplying filter: %v", err)
}

out, err := os.Create("masked.jpg")
if err != nil {
	log.Fatalf("Error writing the file: %s", err)
}

err = jpeg.Encode(out, masked, &jpeg.Options{Quality: 100})
if err != nil {
	log.Fatalf("Error encoding to file: %s", err)
}

Credits

  • Endre Simo - One of the masters of Image Processing (in Go space) [worth following]

Other useful packages

  • awesome-svelte - Resources for killing react
  • dataframe-go - Statistics and data manipulation
  • dbq - Zero boilerplate database operations for Go
  • electron-alert - SweetAlert2 for Electron Applications
  • google-search - Scrape google search results
  • igo - A Go transpiler with cool new syntax such as fordefer (defer for for-loops)
  • mysql-go - Properly cancel slow MySQL queries
  • react - Build front end applications using Go
  • remember-go - Cache slow database queries
  • testing-go - Testing framework for unit testing

The license is a modified MIT license. Refer to LICENSE file for more details.

© 2022 PJ Engineering and Business Solutions Pty. Ltd.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
core module

Jump to

Keyboard shortcuts

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