Skip to content

vitkarpov/lorempixum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Lorempixum

Lorempixum is a golang package for generating stub images with the given sizes.

Install

$ go get github.com/vitkarpov/lorempixum

Overview

Let's take a look at simple usage example.

package main

import (
    "github.com/vitkarpov/lorempixum"
    "os"
)

func main() {
    img := lorempixum.GetImage(100, 100)
    lorempixum.StreamImage(os.Stdout, img, "jpeg")
}

This tiny program writes a new jpeg image to stdout:

$ go build ./example/main.go && ./main > foo.jpeg

Lorempixum supports jpeg, png and gif for animated stubs.

API

func GetImage

func GetImage(width, height int) *image.Paletted

func StreamImage

func StreamImage(out io.Writer, img *image.Paletted, format string) error

About

Golang package for creating images` stubs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages