All Projects → noelyahan → Mergi

noelyahan / Mergi

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

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Mergi

Bimg
Go package for fast high-level image processing powered by libvips C library
Stars: ✭ 1,394 (+997.64%)
Mutual labels:  image, crop, resize, watermark
Docker Nginx Image Proxy
on the fly image cropping with gravity, resize and compression microservice
Stars: ✭ 79 (-37.8%)
Mutual labels:  image, crop, resize
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 (+500%)
Mutual labels:  image, gif, crop
Lipo
👄 Free image manipulation API service built on top of Sharp (an alternative to Jimp, Graphics Magic, Image Magick, and PhantomJS)
Stars: ✭ 101 (-20.47%)
Mutual labels:  image, crop, resize
Gimage
A PHP library for easy image handling. 🖼
Stars: ✭ 148 (+16.54%)
Mutual labels:  image, crop, resize
Imaging
Imaging is a simple image processing package for Go
Stars: ✭ 4,023 (+3067.72%)
Mutual labels:  image, crop, resize
Nova Advanced Image Field
🌄📐 A Laravel Nova advanced image field with cropping and resizing using Cropper.js and Intervention Image
Stars: ✭ 67 (-47.24%)
Mutual labels:  image, crop, resize
Imaginary
Fast, simple, scalable, Docker-ready HTTP microservice for high-level image processing
Stars: ✭ 4,107 (+3133.86%)
Mutual labels:  image, gif, watermark
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 (+16538.58%)
Mutual labels:  image, crop, resize
Lilliput
Resize images and animated GIFs in Go
Stars: ✭ 1,690 (+1230.71%)
Mutual labels:  image, gif, crop
React Text Transition
Animate your text changes
Stars: ✭ 121 (-4.72%)
Mutual labels:  transition, animate
Extended image
A powerful official extension library of image, which support placeholder(loading)/ failed state, cache network, zoom pan image, photo view, slide out page, editor(crop,rotate,flip), paint custom etc.
Stars: ✭ 1,021 (+703.94%)
Mutual labels:  image, crop
Aimage
An animated gif & apng engine for iOS in Swift. Have a great performance on memory and cpu usage.
Stars: ✭ 1,014 (+698.43%)
Mutual labels:  image, gif
Kirby Autofocus
Content aware image cropping for Kirby. Kirby 2 and 3.
Stars: ✭ 35 (-72.44%)
Mutual labels:  image, crop
Abmediaview
Media view which subclasses UIImageView, and can display & load images, videos, GIFs, and audio and from the web, and has functionality to minimize from fullscreen, as well as show GIF previews for videos.
Stars: ✭ 79 (-37.8%)
Mutual labels:  image, gif
Php Image Resize
PHP library to resize, scale and crop images. Cloud solution available at:
Stars: ✭ 955 (+651.97%)
Mutual labels:  crop, resize
Ffimageloading
Image loading, caching & transforming library for Xamarin and Windows
Stars: ✭ 1,288 (+914.17%)
Mutual labels:  image, resize
Stfalconimageviewer
A simple and customizable Android full-screen image viewer with shared image transition support, "pinch to zoom" and "swipe to dismiss" gestures
Stars: ✭ 1,734 (+1265.35%)
Mutual labels:  image, transition
Zoompreviewpicture
拓展性极高类似微信图片和视频浏览,常见应用场景如微信朋友圈照片九宫格和微信聊天图片图片,视频,gif预览
Stars: ✭ 1,576 (+1140.94%)
Mutual labels:  image, gif
React Image File Resizer
Resize Local Images with React 🌄 🌅
Stars: ✭ 108 (-14.96%)
Mutual labels:  image, resize

Mergi

Result Terminal Code
Intro mergi -t TT -i https://raw.githubusercontent.com/ashleymcnamara/gophers/master/Facepalm_Gopher.png -r "131 131" -i https://raw.githubusercontent.com/ashleymcnamara/gophers/master/Facepalm_Picard_Gopher.png -r "131 131" -a "sprite 50"

Go Doc Build Status codecov Go Report Card Teligram Chat

🎉 Basic Overview

Image manipulation go library plus cross platform CLI tool.

⚡ Features

  • 🛠 Merge
  • ✂️ Crop
  • 💣 Resize
  • 🖃 Watermark
  • 💖 Animate
  • 🔥 Easing
  • 🦎 Transition

🚀 Getting started

Install via go get

To install Mergi, use go get, or download the binary file from Releases page.

$ go get github.com/noelyahan/mergi

Usage:

 ╔╦╗╔═╗╦═╗╔═╗╦
 ║║║║╣ ╠╦╝║ ╦║
 ╩ ╩╚═╝╩╚═╚═╝╩
 let's go & make imaging fun
 http://mergi.io
 version 1.0.0

  -a string
    	Enter animation type=[sprite, slide] and the delay to get mergi gif animation ex: smooth 10
  -c value
    	Enter crop points and height and width ex: x y w h
  -f string
    	Enter true if you want to process the final output
  -i value
    	Enter images that want to merge ex: /path/img1 or url
  -o string
    	Enter image outputs file ex: out.png or out.jpg (default "out.png")
  -r value
    	Enter resize width and height of the output ex: 100 200
  -t string
    	Enter a merge template string ex: TBTBTB (default "T")
  -w value
    	Enter watermark image and points to place it, [-r w h] is optional  ex: /path/img -r w h x y


🛠 Merge

Image 1 Image 2 Result Image
dstImage srcImage dstImage
dstImage srcImage dstImage
Mergi Tool
Horizontal
mergi \
-t TT \
-i testdata/mergi_bg_1.png \
-i testdata/mergi_bg_2.png
Vertical
mergi \
-t TB \
-i testdata/mergi_bg_1.png \
-i testdata/mergi_bg_2.png
Mergi Library
image1, _ := mergi.Import(impexp.NewFileImporter("./testdata/mergi_bg_1.png"))
image2, _ := mergi.Import(impexp.NewFileImporter("./testdata/mergi_bg_2.png"))

horizontalImage, _ := mergi.Merge("TT", []image.Image{image1, image2})
mergi.Export(impexp.NewFileExporter(horizontalImage, "horizontal.png"))

verticalImage, _ := mergi.Merge("TB", []image.Image{image1, image2})
mergi.Export(impexp.NewFileExporter(verticalImage, "vertical.png"))

✂️ Crop

Image Result Image
srcImage dstImage
Mergi Tool
mergi \
-i testdata/mergi_bg_1.png \
-c "10 40 200 110"
Mergi Library
img, _ := mergi.Import(impexp.NewFileImporter("./testdata/mergi_bg_1.png"))
res, _ := mergi.Crop(img, image.Pt(10, 40), image.Pt(200, 110))
mergi.Export(impexp.NewFileExporter(res, "crop.png"))

💣 Resize

Image Result Image
srcImage dstImage
Mergi Tool
mergi \
-i testdata/mergi_bg_1.png \
-r "180 80"
Mergi Library
img, _ := mergi.Import(impexp.NewFileImporter("./testdata/mergi_bg_1.png"))
res, _ := mergi.Resize(img, uint(180), uint(80))
mergi.Export(impexp.NewFileExporter(res, "resize.png"))

🖃 Watermark

Image Watermark Image Result Image
srcImage dstImage dstImage
Mergi Tool
mergi \
-i testdata/mergi_bg_1.png \
-w "testdata/mergi_logo_watermark_90x40.png 250 10"
Mergi Library
originalImage, _ := mergi.Import(impexp.NewFileImporter("./testdata/mergi_bg_1.png"))
watermarkImage, _ := mergi.Import(impexp.NewFileImporter("./testdata/glass-mergi_logo_watermark_90x40.jpg"))

res, _ := mergi.Watermark(watermarkImage, originalImage, image.Pt(250, 10))
mergi.Export(impexp.NewFileExporter(res, "watermark.png"))

💖 Animate

Image 1 Image 2 Result Animation
srcImage dstImage dstImage
srcImage dstImage dstImage
Mergi Tool
Sprite Animation
mergi \
-t "TT" \
-i testdata/mergi_bg_1.png \
-i testdata/mergi_bg_2.png \
-a "sprite 50"
Smooth Animation
mergi \
-t "TT" \
-i testdata/mergi_bg_1.png \
-i testdata/mergi_bg_2.png \
-a "smooth 5"
Mergi Library
image1, _ := mergi.Import(impexp.NewFileImporter("./testdata/mergi_bg_1.png"))
image2, _ := mergi.Import(impexp.NewFileImporter("./testdata/mergi_bg_2.png"))

gif, _ := mergi.Animate([]image.Image{image1, image2}, 50)
mergi.Export(impexp.NewAnimationExporter(gif, "out.gif"))

🔥 Easing

dstImage
InBounce
dstImage
InBack
dstImage
InOutQuad
dstImage
InSine
dstImage
InCubic
dstImage
InElastic
dstImage
InOutExpo
dstImage
Linear
dstImage
InOutBounce
dstImage
InCirc
dstImage
InOutCubic
dstImage
InOutQuart
dstImage
InOutBack
dstImage
InCubic
dstImage
InOutCirc
dstImage
InOutSine
dstImage
InExpo
dstImage
OutBounce
dstImage
InQuint
Mergi Library

Note: Ease function can be applied with any function, in this example it's applied with Watermark function

// Load background and the square images
square, _ := mergi.Import(impexp.NewFileImporter("./testdata/square.jpg"))
bg, _ := mergi.Import(impexp.NewFileImporter("./testdata/white_bg.jpg"))

// Init images frames to add applied ease frames
frames := make([]image.Image, 0)

// Init the limts of the Ease
to := bg.Bounds().Max.X - square.Bounds().Max.X
posY := bg.Bounds().Max.Y/2 - square.Bounds().Max.Y/2
speed := 4

// Ease from 0 to width of background
for i := 0; i < to; i += speed {
  // Apply Easeing function InBounce
  posX := mergi.Ease(float64(i), 0, float64(to), mergi.InBounce)
  img, _ := mergi.Watermark(square, bg, image.Pt(int(posX), posY))
  frames = append(frames, img)
}

// For preview example, save as a gif
gif, _ := mergi.Animate(frames, 1)
mergi.Export(impexp.NewAnimationExporter(gif, "out.gif"))

🦎 Transition

dstImage
SlideBar
dstImage
Ink1
dstImage
Ink2
dstImage
Ink3
dstImage
ScaleUpFastRect
dstImage
ScaleDownFastRect
dstImage
ScaleUpFastCircle
dstImage
ScaleDownFastCircle

Learn more examples

💻 Contribute

  • Clone the repository
$ go get github.com/noelyahan/mergi
  • Run unit tests
  • Fix bug
  • Add new feature
  • Push

🌠 Contributors


Noel

💻 📖 💬 👀 🤔 🎨

This project follows the all-contributors specification. Contributions of any kind are welcome!


🔵 License

This project is licensed under the MIT License - see the LICENSE.md file for details

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].