Asset storage and on-the-fly image resize

air - Asset & Image Resize

Asset storage and on-the-fly image resize powered by libvips.

Uploading an asset

$ http -f POST http://127.0.0.1:1323/upload [email protected]
HTTP/1.1 201 Created
Access-Control-Allow-Origin: *
Content-Length: 78
Content-Type: application/json; charset=UTF-8
Date: Fri, 04 Feb 2022 02:31:54 GMT
Location: /b056dab52b1ad845a72da28ab28bcc39948011ec68122ff791da252afdfcd67e
Vary: Origin

{
    "id": "b056dab52b1ad845a72da28ab28bcc39948011ec68122ff791da252afdfcd67e"
}

Retrieving an asset

Retrieve an asset in the format it was uploaded:

$ http http://127.0.0.1:1323/b056dab52b1ad845a72da28ab28bcc39948011ec68122ff791da252afdfcd67e

HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Type: image/png
Date: Fri, 04 Feb 2022 02:32:10 GMT
Transfer-Encoding: chunked
Vary: Origin

Retrieve an image asset in a different format:

$ http http://127.0.0.1:1323/b056dab52b1ad845a72da28ab28bcc39948011ec68122ff791da252afdfcd67e?format=jpeg
Content-Type: image/jpeg

Valid formats are jpeg, png and webp.

Retrieve an image asset in a different size:

$ http http://127.0.0.1:1323/b056dab52b1ad845a72da28ab28bcc39948011ec68122ff791da252afdfcd67e?size=640x480

Valid size parameters (max size: 5000x5000):

size=640x480 # force size, that is, break aspect ratio
size=640  # will scale the height accordingly
width=640&height=480 # force size, that is, break aspect ratio
width=640  # will scale the height accordingly
height=480  # will scale the width accordingly

Retrieve an image asset in a different quality:

$ http http://127.0.0.1:1323/b056dab52b1ad845a72da28ab28bcc39948011ec68122ff791da252afdfcd67e?quality=50

The quality must be between 1 and 100.

Development

Install libvips by following the instructions here.

Installing dependencies

$ make dev

Building and running

$ make run

Running tests

$ make test
Owner
Similar Resources

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

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 package for decoding and encoding TARGA image format

tga tga is a Go package for decoding and encoding TARGA image format. It supports RLE and raw TARGA images with 8/15/16/24/32 bits per pixel, monochro

Sep 26, 2022

Image resizing in pure Go and SIMD

rez Package rez provides image resizing in pure Go and SIMD. Download: go get github.com/bamiaux/rez Full documentation at http://godoc.org/github.com

Dec 11, 2022

A Go program that takes an image, uses pigo to detect a face, and creates a gif that zooms in on the face

A Go program that takes an image, uses pigo to detect a face, and creates a gif that zooms in on the face

ok-zoomer Every GIF is a gift. How it works face detection with esimov/pigo color quantization / dithering with esimov/colorquant image resizing with

Nov 27, 2022

An extensive, fast, and accurate command-line image dithering tool.

An extensive, fast, and accurate command-line image dithering tool.

didder is an extensive, fast, and accurate command-line image dithering tool. It is designed to work well for both power users as well as pipeline scripting. It is backed by my dithering library, and is unique in its correctness and variety of dithering algorithms.

Dec 31, 2022

A lightweight and easy to use tool for deflickering timelapse image sequences.

A lightweight and easy to use tool for deflickering timelapse image sequences.

Simple Deflicker A minimalist, lightning-fast and easy to use tool for deflickering image sequences such as timelapses. It's still in its early stages

Aug 12, 2022

📸 Clean your image folder using perceptual hashing and BK-trees using Go!

📸 Clean your image folder using perceptual hashing and BK-trees using Go!

Image Cleaner 🏞 🏞 ➡ 🏞 This tool can take your image gallery and create a new folder with image-alike-cluster folders. It uses a perceptual image ha

Oct 8, 2022

Pbm - Package ppm implements a Portable Bit Map (PBM) image decoder and encoder written in Go

Package pbm import "github.com/slashformotion/pbm" Package pbm implements a Portable Bit Map (PBM) image decoder and encoder. The supported image col

Jan 5, 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
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
Image - This repository holds supplementary Go image librariesThis repository holds supplementary Go image libraries

Go Images This repository holds supplementary Go image libraries. Download/Insta

Jan 5, 2022
Resize images and animated GIFs in Go

Lilliput relies on mature, high-performance C libraries to do most of the work of decompressing, resizing and compressing images. It aims to do as little memory allocation as possible and especially not to create garbage in Go. As a result, it is suitable for very high throughput image resizing services.

Jan 3, 2023
Resize upladed images to s3 bucket with given sizes, and uploades new images back to bucket

Features Resize upladed images to s3 bucket with given sizes, and uploades new images back to bucket Environment Variables IMAGE_SIZES - formax 200x20

Feb 2, 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
Storage and image processing server written in Go
Storage and image processing server written in Go

Mort An S3-compatible image processing server written in Go. Still in active development. Features HTTP server Resize, Rotate, SmartCrop Convert (JPEG

Jan 7, 2023
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
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
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