Skip to content

kotaroyamazaki/go-ogpgen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

a simple og image generator written in Go

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages