https://github.com/vitkarpov/lorempixum
Golang package for creating images` stubs
https://github.com/vitkarpov/lorempixum
Last synced: about 2 months ago
JSON representation
Golang package for creating images` stubs
- Host: GitHub
- URL: https://github.com/vitkarpov/lorempixum
- Owner: vitkarpov
- Created: 2016-01-31T11:33:56.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-01T16:01:44.000Z (about 9 years ago)
- Last Synced: 2025-01-17T23:19:42.667Z (3 months ago)
- Language: Go
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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.
```go
package mainimport (
"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
```go
func GetImage(width, height int) *image.Paletted
```#### func StreamImage
```go
func StreamImage(out io.Writer, img *image.Paletted, format string) error
```