1. Products
  2.   Image
  3.   GO
  4.   GeoPattern
 
  

Open Source Image Manipulation Library for Go Developers

Free API to create beautiful generative image patterns from a string in Go.

GeoPattern is an open-source API for Go developers to create generative image patters from a string from with in the application. The API generats tiling SVG patterns from a string. By determining the values in the sting hash, it is converted into SHA, color and a pattern. You can change the color of the output image by changing the hue from a default base color. The API provides 16 different pattern options and you can use one at a time.

THe SVG output of the API is great for the retina displays. It allows the users to use the images as a background image for a container. Using the API, you can create chevrons, concentric-circles, diamonds, hexagons, mosaic-squares, nested-squares, octagons, overlapping-circles, overlapping-rings, plaid, plus-signs, sine-waves, squares, tessellation, triangles and xes patterns.

Previous Next

Getting Started with GeoPattern

The easiest and recommend way to install GeoPattern is via GitHub. Please use the following command for an easy and smooth installation.

Install GeoPattern via GitHub

 go get github.com/pravj/geopattern

Generate Pattern Images via GO Library

The open source GeoPattern library enables software developers to programmatically generate geo pattern drawings inside their own application using Go commands. Developers need to parse the custom pattern phrase, and then generate the then generate the pattern by selecing any type. The Developer can also set base color and background color of the generated geo patterns.

Create Pattern Images via GO API

package main

import (
	"fmt"
	"github.com/pravj/geopattern"
)

// Prints pattern's SVG string for a specific pattern
func main() {
	args := map[string]string{"generator": "squares"}
	gp := geopattern.Generate(args)
	fmt.Println(gp)
}

Pattern Image creation with Specific Base Background Color via GO

package main

import (
	"fmt"
	"github.com/pravj/geopattern"
)

// Prints pattern's SVG string with a specific base background color
func main() {
	args := map[string]string{"baseColor": "#e2b"}
	gp := geopattern.Generate(args)
	fmt.Println(gp)
}
 English