All Projects → DAddYE → Vips

DAddYE / Vips

Go Bindings for Vips (a super fast image processor)

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Vips

Libvips
A fast image processing library with low memory needs.
Stars: ✭ 6,094 (+1503.68%)
Mutual labels:  jpeg, imagemagick, libvips
Govips
A lightning fast image processing and resizing library for Go
Stars: ✭ 442 (+16.32%)
Mutual labels:  jpeg, imagemagick, libvips
Imaginary
Fast, simple, scalable, Docker-ready HTTP microservice for high-level image processing
Stars: ✭ 4,107 (+980.79%)
Mutual labels:  jpeg, libvips
Imgproxy
Fast and secure standalone server for resizing and converting remote images
Stars: ✭ 5,688 (+1396.84%)
Mutual labels:  jpeg, libvips
Optimise Images
Batch image resizer, optimiser and profiler using ImageMagick convert, OptiPNG, JpegOptim and optional ZopfliPNG, Guetzli and MozJPEG.
Stars: ✭ 64 (-83.16%)
Mutual labels:  jpeg, imagemagick
Mort
Storage and image processing server written in Go
Stars: ✭ 420 (+10.53%)
Mutual labels:  jpeg, libvips
Flyimg
Dockerized PHP7 application runs as a Microservice to resize and crop images on the fly. Get optimised images with MozJPEG, WebP or PNG using ImageMagick. Includes face detection, cropping, face blurring, image rotation and many other options. Abstract storage based on FlySystem in order to store images on any provider (local, AWS S3...).
Stars: ✭ 762 (+100.53%)
Mutual labels:  jpeg, imagemagick
imagor
Fast, Docker-ready image processing server in Go and libvips
Stars: ✭ 2,276 (+498.95%)
Mutual labels:  jpeg, libvips
srcset.sh
A command line script that generates multiple responsive versions of an image at width breakpoints -- 320,480,640,768,960,1024,1280,1440 pixels wide -- that match common Mobile and widescreen desktop/laptop viewports using Imagemagick's convert utility and outputs the needed <img/> tag
Stars: ✭ 20 (-94.74%)
Mutual labels:  imagemagick, jpeg
Bimg
Go package for fast high-level image processing powered by libvips C library
Stars: ✭ 1,394 (+266.84%)
Mutual labels:  jpeg, libvips
Skrop
Image transformation service using libvips, based on Skipper.
Stars: ✭ 71 (-81.32%)
Mutual labels:  jpeg, libvips
Sharp
High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, AVIF and TIFF images. Uses the libvips library.
Stars: ✭ 21,131 (+5460.79%)
Mutual labels:  jpeg, libvips
wrender
Image compression and transformation reverse-proxy for Express apps
Stars: ✭ 14 (-96.32%)
Mutual labels:  jpeg, libvips
Tifig
A fast HEIF image converter aimed at thumbnailing
Stars: ✭ 345 (-9.21%)
Mutual labels:  jpeg, libvips
Djv
Professional media review software for VFX, animation, and film production
Stars: ✭ 282 (-25.79%)
Mutual labels:  jpeg
Compress Images
Minify size your images. Image compression with extension: jpg/jpeg, svg, png, gif. NodeJs
Stars: ✭ 331 (-12.89%)
Mutual labels:  jpeg
Imager
Automated image compression for efficiently distributing images on the web.
Stars: ✭ 266 (-30%)
Mutual labels:  jpeg
Selene
A C++17 image representation, processing and I/O library.
Stars: ✭ 266 (-30%)
Mutual labels:  jpeg
Skeptick
Better ImageMagick for Ruby
Stars: ✭ 326 (-14.21%)
Mutual labels:  imagemagick
Androidsvgdrawable Plugin
Gradle plugin that generates qualified, density specific PNG drawables from SVG files at build time for your Android projects.
Stars: ✭ 263 (-30.79%)
Mutual labels:  jpeg

Vips for go

This package is powered by the blazingly fast libvips image processing library, originally created in 1989 at Birkbeck College and currently maintained by JohnCupitt.

This is a loosely port of sharp an awesome module for node.js built by Lovell Fuller

The typical use case for this high speed package is to convert large images of many formats to smaller, web-friendly JPEG, PNG images of varying dimensions.

The performance of JPEG resizing is typically 8x faster than ImageMagick and GraphicsMagick, based mainly on the number of CPU cores available.

When generating JPEG output all metadata is removed and Huffman tables optimised without having to use separate command line tools like jpegoptim and jpegtran.

Installation

go get github.com/daddye/vips

libvips can take advantage of liborc if present.

Install libvips on Mac OS

brew install homebrew/science/vips --without-fftw --without-libexif --without-libgsf \
  --without-little-cms2 --without-orc --without-pango --without-pygobject3 \
  --without-gobject-introspection --without-python

Install libvips on Linux

Compiling from source is recommended:

sudo apt-get install automake build-essential git gobject-introspection \
  libglib2.0-dev libjpeg-turbo8-dev libpng12-dev gtk-doc-tools
git clone https://github.com/jcupitt/libvips.git
cd libvips
./bootstrap.sh
./configure --enable-debug=no --without-python --without-fftw --without-libexif \
  --without-libgf --without-little-cms --without-orc --without-pango --prefix=/usr
make
sudo make install
sudo ldconfig

Usage

You can use package from the command line (go install github.com/daddye/vips/vips-cmd):

vips-cmd -file test.jpg -width 400 -height 600 > /tmp/test.jpg

Or simply importing the package and then:

options := vips.Options{
	Width:        800,
	Height:       600,
	Crop:         false,
	Extend:       vips.EXTEND_WHITE,
	Interpolator: vips.BILINEAR,
	Gravity:      vips.CENTRE,
	Quality:      95,
}
f, _ := os.Open("/tmp/test.jpg")
inBuf, _ := ioutil.ReadAll(f)
buf, err := vips.Resize(inBuf, options)
if err != nil {
	fmt.Fprintln(os.Stderr, err)
	return
}
// do some with your resized image `buf`

Performance

Test by @lovell

Test environment

  • Intel Xeon L5520 2.27GHz 8MB cache
  • Ubuntu 13.10
  • libvips 7.38.5

The contenders

  • imagemagick-native - Supports Buffers only and blocks main V8 thread whilst processing.
  • imagemagick - Supports filesystem only and "has been unmaintained for a long time".
  • gm - Fully featured wrapper around GraphicsMagick.
  • sharp - Caching within libvips disabled to ensure a fair comparison.

The task

Decompress a 2725x2225 JPEG image, resize and crop to 720x480, then compress to JPEG.

Results

Module Input Output Ops/sec Speed-up
imagemagick-native buffer buffer 0.97 1
imagemagick file file 2.49 2.6
gm buffer file 3.72 3.8
gm buffer buffer 3.80 3.9
gm file file 3.67 3.8
gm file buffer 3.67 3.8
sharp buffer file 13.62 14.0
sharp buffer buffer 12.43 12.8
sharp file file 13.02 13.4
sharp file buffer 11.15 11.5
sharp +sharpen file buffer 10.26 10.6
sharp +progressive file buffer 9.44 9.7
sharp +sequentialRead file buffer 11.94 12.3

You can expect much greater performance with caching enabled (default) and using 16+ core machines.

Thanks

This module would never have been possible without the help and code contributions of the following people:

License

Copyright (C) 2014 Davide D'Agostino

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].