Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 1.04 KB

README.md

File metadata and controls

44 lines (30 loc) · 1.04 KB

go-ogpgen

a simple og image generator written in Go

Overview

Generate from a randomly colored background and text

Generated from base image and text

overview

(The Gopher on the base iamge was designed by Renée French.)

Usage

code example

a simple example composed background image and text.

func main() {
	g := ogpgen.NewRandomBackGround()
	if err := g.AttachText(&ogpgen.TextCompositionParams{
		Text: "Hello, World!",
	}); err != nil {
		panic(err)
	}

    if err := g.Save("output.jpg"); err != nil {
		panic(err)
	}
}
open ./output.jpg

The code for the more complex case of combining images and text, as shown in the overview, is available in /demo/baseimage_with_text