https://github.com/pedro-gutierrez/goimg
A simple Golang image resizing command line utility, based on Libvips and Bimg.
https://github.com/pedro-gutierrez/goimg
bimg golang image-processing libvips thumbnail
Last synced: 8 months ago
JSON representation
A simple Golang image resizing command line utility, based on Libvips and Bimg.
- Host: GitHub
- URL: https://github.com/pedro-gutierrez/goimg
- Owner: pedro-gutierrez
- License: mit
- Created: 2018-07-08T09:28:38.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-08T15:10:05.000Z (almost 8 years ago)
- Last Synced: 2024-12-28T11:45:33.380Z (over 1 year ago)
- Topics: bimg, golang, image-processing, libvips, thumbnail
- Language: Go
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Goimg
A simple Golang image resizing command line utility, based on Libvips and Bimg.
## Building
Make sure you have Libvips installed. Then simply clone this repo and run:
```
go get
go install
```
## Usage
The following command will download the original file at the specified url, and will produce the following 4 thumbnails:
* /tmp/sierra-original.jpg
* /tmp/sierra-big.jpg
* /tmp/sierra-regular.jpg
* /tmp/sierra-small.jpg
```
goimg url https://cdn-images-1.medium.com/max/2000/1*4BPoUrWcf67bdaKyZPARMg.png /tmp sierra jpg big,regular,small
```
## Presets
Goimg comes with the following thumbnail size presets:
```
sizes := map[string]int{
"large": 1024,
"big": 800,
"regular": 480,
"small": 320,
"tiny": 128,
}
```
Goimg uses Libvips smartcrop in order to normalize aspect ratios that are bigger than 16:9. For smaller aspect ratios, the original value is kept.
## Related projects
* Libvips: https://github.com/jcupitt/libvips
* Bimg: https://github.com/h2non/bimg
* Imaginary: https://github.com/h2non/imaginary