Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hawx/img
A selection of image manipulation tools
https://github.com/hawx/img
Last synced: 24 days ago
JSON representation
A selection of image manipulation tools
- Host: GitHub
- URL: https://github.com/hawx/img
- Owner: hawx
- License: mit
- Created: 2012-07-28T19:57:47.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2015-05-01T15:11:26.000Z (about 9 years ago)
- Last Synced: 2024-01-30T04:49:11.231Z (4 months ago)
- Language: Go
- Homepage: hawx.me/code/img
- Size: 9.18 MB
- Stars: 151
- Watchers: 5
- Forks: 12
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-go - img - Selection of image manipulation tools. (Images / Search and Analytic Databases)
- awesome-go - img - Selection of image manipulation tools. (Images / Search and Analytic Databases)
- awesome-cobol - img - A selection of image manipulation tools. (Imagery / Middlewares)
- awesome-go-extra - img - 07-28T19:57:47Z|2015-05-01T15:11:26Z| (Images / Advanced Console UIs)
- awesome-go-cn - img
- awesome-go-zh - img
- awesome-go - img - Selection of image manipulation tools. (Images / Search and Analytic Databases)
- awesome-go - img - | - | - | (Images / Advanced Console UIs)
- awesome-go - img - Selection of image manipulation tools. (Images / Advanced Console UIs)
- fucking-awesome-go - :octocat: img - A selection of image manipulation tools. :star: 76 :fork_and_knife: 2 (Images / Advanced Console UIs)
- awesome-go - img - Selection of image manipulation tools. (Images / Advanced Console UIs)
- awesome-go-projects - img - Selection of image manipulation tools. (Images / Standard CLI)
- awesome-go - img - Selection of image manipulation tools. (Images / Search and Analytic Databases)
- awesome-go - img - A selection of image manipulation tools. (Images / Advanced Console UIs)
- awesome-go-with-framework - img - Selection of image manipulation tools. (Images / Advanced Console UIs)
- awesome-go - img - Selection of image manipulation tools. (Images / Search and Analytic Databases)
- awesome-go-cn - img
- awesome-go - img - A selection of image manipulation tools. (Images / Advanced Console UIs)
- awesome-go - img - Selection of image manipulation tools. (Images / Advanced Console UIs)
- awesome-go - img - Selection of image manipulation tools. (<span id="图片-images">图片 Images</span> / <span id="高级控制台用户界面-advanced-console-uis">高级控制台用户界面 Advanced Console UIs</span>)
- awesome-go. - img - Selection of image manipulation tools. (Images / Advanced Console UIs)
- awesome-go-cn - img - 图像操作工具精选集 (图像 / 高级控制台界面)
- awesome-go-with-stars - img - Selection of image manipulation tools. (Images / Search and Analytic Databases)
- awesome-go - img - Selection of image manipulation tools. (Images / Advanced Console UIs)
- repo-1316-awesome-go-cn - img
- repo-1211-awesome-go-cn - img
- awesome-Char - img - Selection of image manipulation tools. (Images / Advanced Console UIs)
- awesome-reader - img - Selection of image manipulation tools. (Images / Advanced Console UIs)
- awesome-go - img - Selection of image manipulation tools. (Images / Advanced Console UIs)
- Go-awesome - img - Selection of image manipulation tools. (Images / Search and Analytic Databases)
- awesome-go-cn - img
- awesome-go - img - A selection of image manipulation tools. (Images / Advanced Console UIs)
- awesome-go-cn - img
- awesome-go-handwritten - img - Selection of image manipulation tools. (Images / Advanced Console UIs)
- awesome-go - img - 圖象操作工具精選集 (圖象 / 高級控制台界面)
- awesome-go-stars - img(stars: 152) - Selection of image manipulation tools. (Images / Search and Analytic Databases)
- awesome-go2 - img - Selection of image manipulation tools. (Images / Advanced Console UIs)
- awesome-go - img - Selection of image manipulation tools. (Images / Advanced Console UIs)
- awesome-go - img - Selection of image manipulation tools. - :arrow_down:0 - :star:80 (Images / Advanced Console UIs)
- awesome-go - img - Selection of image manipulation tools. (Images / Search and Analytic Databases)
- awesome-go - img - A selection of image manipulation tools. (Images / Advanced Console UIs)
- awesome-go - img - Selection of image manipulation tools. (Images / Advanced Console UIs)
- awesome-go-cn - img
- awesome-go-zh - img
- awesome-go - img - Selection of image manipulation tools. (Images / Search and Analytic Databases)
- awesome-go - img - Selection of image manipulation tools. (Images / Search and Analytic Databases)
- go-awesome-cn-star - img
- awesome-go - img - A selection of image manipulation tools - ★ 125 (Images)
README
# img [![docs](http://godoc.org/hawx.me/code/img?status.svg)](http://godoc.org/hawx.me/code/img)
A collection of image manipulation tools. Each tool takes an input file from
standard input, this needs to be in PNG, JPEG or GIF format. They output the
resulting image (by default in PNG format) to standard output.To install run,
``` bash
$ go install hawx.me/code/img
```You can then run `go help` and `go help [command]` for information.
> The aim of _img_ is not to be fast, if you want fast use
> [GraphicsMagick](http://www.graphicsmagick.org/), the aim is to be
> readable. Diving through endless files of C and C++ to find out how a certain
> effect is implemented is no fun, reading a single Go file is hopefully better.## Example (Command Line)
Here is an example: First we convert the image to greyscale using the values
from the red colour channel, then boost the contrast slightly using a linear
function, and finally tint the image with a dark red.``` bash
(img greyscale --red | \
img contrast --linear --ratio 1.5 | \
img tint --with '#83121344') < input.png > output.png
```You can see here how easy it is to chain different tools together using pipes.
## Example (Go)
You can also use the _img_ libraries in Go code. We could rewrite the previous
example as,``` go
// example.go
package mainimport (
"hawx.me/code/img/contrast"
"hawx.me/code/img/greyscale"
"hawx.me/code/img/tint""image/png"
"os"
)func main() {
input, _ := os.Open(os.Args[1])
img, _ := png.Decode(input)img = greyscale.Red(img)
img = contrast.Linear(img, 1.5)
img = tint.Tint(img, color.NRGBA{131, 18, 19, 255})output, _ := os.Create(os.Args[2])
png.Encode(output, img)
}
```This can then be compiled and run like `./example input.png output.png`.