https://github.com/deiwin/picasso
A Go image composer
https://github.com/deiwin/picasso
collage image image-composer
Last synced: 5 months ago
JSON representation
A Go image composer
- Host: GitHub
- URL: https://github.com/deiwin/picasso
- Owner: deiwin
- License: mit
- Created: 2015-09-05T19:35:02.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-09-29T14:23:47.000Z (over 10 years ago)
- Last Synced: 2024-06-19T01:48:28.335Z (almost 2 years ago)
- Topics: collage, image, image-composer
- Language: Go
- Size: 13 MB
- Stars: 201
- Watchers: 6
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Picasso, a Go image composer
[](https://travis-ci.org/deiwin/picasso)
[](http://gocover.io/github.com/deiwin/picasso)
[](https://godoc.org/github.com/deiwin/picasso)
## Example
### Manual layout handling
The following code:
```go
image := picasso.HorizontalSplit{
Ratio: 2,
Top: picasso.Picture{bullfight},
Bottom: picasso.VerticalSplit{
Ratio: 0.5,
Left: picasso.Picture{girlBeforeAMirror},
Right: picasso.VerticalSplit{
Ratio: 1,
Left: picasso.Picture{oldGuitarist},
Right: picasso.Picture{womenOfAlgiers},
},
},
}.Draw(400, 600)
```
Will compose the following image:

### Automatic layouts
*Picasso* also supports different automatic layouts and borders, so that the following code:
```go
images := []image.Image{
girlBeforeAMirror,
oldGuitarist,
womenOfAlgiers,
bullfight,
weepingWoman,
laReve,
}
layout := picasso.GoldenSpiralLayout()
gray := color.RGBA{0xaf, 0xaf, 0xaf, 0xff}
image := layout.Compose(images).DrawWithBorder(600, 600, gray, 2)
```
Will compose an image using the golden ratio:

Or one could use the GridLayout:
```go
images := []image.Image{...}
gray := color.RGBA{0xaf, 0xaf, 0xaf, 0xff}
image := picasso.DrawGridLayoutWithBorder(images, 800, gray, 2)
```
to compose larger sets of images:

*See tests for more examples*