A Go-language library for the automatic generation of image collages.

CollageCreator

CollageCreator is a Go-language library for the automatic generation of image collages.

Library design

As a library, CollageCreator is designed to be extensible by third parties. Its workflow separates the process of collage creation into four distinct steps -- reading input images, preprocessing, collage layout, and output rendering -- and a custom implementation may be substituted for any of these steps via the API.

Provided implementations

The core library provides the following implementations for each step:

  • Input image reading via Go's built-in image library.

  • Preprocessing via a command-line switch that lets the user provide an ImageMagick-like geometry string specifying how images are to be scaled and cropped.

  • Collage layout via one of two algorithms:

    • Random placement: Images are placed at random and then adjusted to leave each image equidistant from its nearest neighbor. A binary search algorithm is used to minimize the total canvas area.

    • Tile in order: Images are placed in rows of identical width, images being scaled down to fit. An optimization algorithm is used to find a canvas size that minimizes (1) deviation from the provided aspect ratio; (2) empty space in the last row or column; and (3) the amount by which any image must be scaled down.

  • Output rendering as:

    • A PNG, JPEG, or TIFF raster image.

    • A Scalable Vector Graphics (SVG) file, using links to reference each input image file.

    • A shell script that runs ImageMagick tools to build the collage image.

Dependencies

For raster image output, CollageCreator depends on Jan Schlicht's "resize" package for image scaling.

When the sh output file type is selected, the output shell scripts require the ImageMagick command-line tools to run.

Known deficiencies

As the built-in Go image library does not read Exif metadata, CollageCreator does not take Exif orientation into account when reading images. All images read using this library must be physically rotated before input to ensure correct operation.

Owner
Similar Resources

A lightning fast image processing and resizing library for Go

govips A lightning fast image processing and resizing library for Go This package wraps the core functionality of libvips image processing library by

Jan 8, 2023

go library for image programming (merge, crop, resize, watermark, animate, ease, transit)

go library for image programming (merge, crop, resize, watermark, animate, ease, transit)

Result Terminal Code mergi -t TT -i https://raw.githubusercontent.com/ashleymcnamara/gophers/master/Facepalm_Gopher.png -r "131 131" -i https://raw.gi

Jan 6, 2023

A fast, correct image dithering library in Go.

dither is a library for dithering images in Go. It has many dithering algorithms built-in, and allows you to specify your own. Correctness is a

Dec 27, 2022

Content aware image resize library

Content aware image resize library

Caire is a content aware image resize library based on Seam Carving for Content-Aware Image Resizing paper. How does it work An energy map (edge detec

Jan 2, 2023

ColorX is a library to determine the most prominent color in an image written in golang

ColorX is a library to determine the most prominent color in an image. ColorX doesn't use any sort of complex algorithms to calculate the prominent color, it simply loops over the image pixels and returns the color that occurs the most.

Nov 11, 2021

A library for basic image processing in Go.

A library for basic image processing in Go.

Imaging Package imaging provides basic image processing functions (resize, rotate, crop, brightness/contrast adjustments, etc.). All the image process

Nov 26, 2021

A library for basic image processing in Go.

A library for basic image processing in Go.

Imaging Package imaging provides basic image processing functions (resize, rotate, crop, brightness/contrast adjustments, etc.). All the image process

Nov 26, 2021

Dendrite is a second-generation Matrix homeserver written in Go!

Dendrite Dendrite is a second-generation Matrix homeserver written in Go. It intends to provide an efficient, reliable and scalable alternative to Syn

Jan 8, 2023

Procedural texture generation package.

Procedural texture generation package.

Texture Generation A package for the procedural generation of textures. Based on the ideas contained in the Bryce 3D deep texture editor. More example

Sep 8, 2022
Go package captcha implements generation and verification of image and audio CAPTCHAs.
Go package captcha implements generation and verification of image and audio CAPTCHAs.

Package captcha ⚠️ Warning: this captcha can be broken by advanced OCR captcha breaking algorithms. import "github.com/dchest/captcha" Package captch

Dec 30, 2022
Go Language Library for SVG generation
Go Language Library for SVG generation

SVGo: A Go library for SVG generation The library generates SVG as defined by the Scalable Vector Graphics 1.1 Specification (http://www.w3.org/TR/SVG

Jan 6, 2023
Avatar generation library for GO language
Avatar generation library for GO language

GOvatar GOvatar is an avatar generation library written in GO Install To install the library and command-line program, use the following: $ go get -u

Dec 29, 2022
darkroom - An image proxy with changeable storage backends and image processing engines with focus on speed and resiliency.
darkroom - An image proxy with changeable storage backends and image processing engines with focus on speed and resiliency.

Darkroom - Yet Another Image Proxy Introduction Darkroom combines the storage backend and the image processor and acts as an Image Proxy on your image

Dec 6, 2022
Easily customizable Social image (or Open graph image) generator

fancycard Easily customizable Social image (or Open graph image) generator Built with Go, Gin, GoQuery and Chromedp Build & Run Simply, Clone this rep

Jan 14, 2022
An API which allows you to upload an image and responds with the same image, stripped of EXIF data

strip-metadata This is an API which allows you to upload an image and responds with the same image, stripped of EXIF data. How to run You need to have

Nov 25, 2021
Imgpreview - Tiny image previews for HTML while the original image is loading
Imgpreview - Tiny image previews for HTML while the original image is loading

imgpreview This is a Go program that generates tiny blurry previews for images t

May 22, 2022
Image resizing for the Go programming language with common interpolation methods

This package is no longer being updated! Please look for alternatives if that bothers you. Resize Image resizing for the Go programming language with

Dec 14, 2021
Go package for fast high-level image processing powered by libvips C library

bimg Small Go package for fast high-level image processing using libvips via C bindings, providing a simple programmatic API. bimg was designed to be

Jan 2, 2023
Image processing library and rendering toolkit for Go.

blend Image processing library and rendering toolkit for Go. (WIP) Installation: This library is compatible with Go1. go get github.com/phrozen/blend

Nov 11, 2022