{"id":13413202,"url":"https://github.com/hawx/img","last_synced_at":"2025-03-14T19:31:36.629Z","repository":{"id":4107705,"uuid":"5217244","full_name":"hawx/img","owner":"hawx","description":"A selection of image manipulation tools","archived":false,"fork":false,"pushed_at":"2015-05-01T15:11:26.000Z","size":9622,"stargazers_count":153,"open_issues_count":4,"forks_count":11,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-07-31T20:52:01.578Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"hawx.me/code/img","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hawx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-28T19:57:47.000Z","updated_at":"2024-07-18T16:31:59.000Z","dependencies_parsed_at":"2022-08-06T15:00:30.684Z","dependency_job_id":null,"html_url":"https://github.com/hawx/img","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hawx%2Fimg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hawx%2Fimg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hawx%2Fimg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hawx%2Fimg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hawx","download_url":"https://codeload.github.com/hawx/img/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243635265,"owners_count":20322906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T20:01:35.060Z","updated_at":"2025-03-14T19:31:36.325Z","avatar_url":"https://github.com/hawx.png","language":"Go","funding_links":[],"categories":["Images","Relational Databases","Images 图像处理","图片","图像","圖象","Imagery","\u003cspan id=\"图片-images\"\u003e图片 Images\u003c/span\u003e"],"sub_categories":["Advanced Console UIs","Search and Analytic Databases","SQL 查询语句构建库","检索及分析资料库","高级控制台界面","高級控制台界面","交流","Middlewares","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e"],"readme":"# img [![docs](http://godoc.org/hawx.me/code/img?status.svg)](http://godoc.org/hawx.me/code/img)\n\nA collection of image manipulation tools. Each tool takes an input file from\nstandard input, this needs to be in PNG, JPEG or GIF format. They output the\nresulting image (by default in PNG format) to standard output.\n\nTo install run,\n\n``` bash\n$ go install hawx.me/code/img\n```\n\nYou can then run `go help` and `go help [command]` for information.\n\n\u003e The aim of _img_ is not to be fast, if you want fast use\n\u003e [GraphicsMagick](http://www.graphicsmagick.org/), the aim is to be\n\u003e readable. Diving through endless files of C and C++ to find out how a certain\n\u003e effect is implemented is no fun, reading a single Go file is hopefully better.\n\n\n## Example (Command Line)\n\nHere is an example: First we convert the image to greyscale using the values\nfrom the red colour channel, then boost the contrast slightly using a linear\nfunction, and finally tint the image with a dark red.\n\n``` bash\n(img greyscale --red | \\\n  img contrast --linear --ratio 1.5 | \\\n  img tint --with '#83121344') \u003c input.png \u003e output.png\n```\n\nYou can see here how easy it is to chain different tools together using pipes.\n\n\n## Example (Go)\n\nYou can also use the _img_ libraries in Go code. We could rewrite the previous\nexample as,\n\n``` go\n// example.go\npackage main\n\nimport (\n  \"hawx.me/code/img/contrast\"\n  \"hawx.me/code/img/greyscale\"\n  \"hawx.me/code/img/tint\"\n\n  \"image/png\"\n  \"os\"\n)\n\nfunc main() {\n  input, _ := os.Open(os.Args[1])\n  img,   _ := png.Decode(input)\n\n  img = greyscale.Red(img)\n  img = contrast.Linear(img, 1.5)\n  img = tint.Tint(img, color.NRGBA{131, 18, 19, 255})\n\n  output, _ := os.Create(os.Args[2])\n  png.Encode(output, img)\n}\n```\n\nThis can then be compiled and run like `./example input.png output.png`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhawx%2Fimg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhawx%2Fimg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhawx%2Fimg/lists"}