{"id":24930640,"url":"https://github.com/logica0419/resigif","last_synced_at":"2025-04-09T21:51:24.283Z","repository":{"id":219875606,"uuid":"745956961","full_name":"logica0419/resigif","owner":"logica0419","description":"Animated GIF resizing library w/o cgo or any third-party Libraries","archived":false,"fork":false,"pushed_at":"2025-04-06T18:11:17.000Z","size":817,"stargazers_count":9,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T21:51:18.912Z","etag":null,"topics":["gif","go","image-processing","resize"],"latest_commit_sha":null,"homepage":"","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/logica0419.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-20T16:55:45.000Z","updated_at":"2025-04-06T18:11:20.000Z","dependencies_parsed_at":"2024-05-05T18:26:30.449Z","dependency_job_id":"3ac1d51c-d5f1-4d68-b048-3966aecfe6c2","html_url":"https://github.com/logica0419/resigif","commit_stats":null,"previous_names":["logica0419/resigif"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logica0419%2Fresigif","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logica0419%2Fresigif/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logica0419%2Fresigif/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logica0419%2Fresigif/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logica0419","download_url":"https://codeload.github.com/logica0419/resigif/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119402,"owners_count":21050754,"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":["gif","go","image-processing","resize"],"created_at":"2025-02-02T13:55:12.319Z","updated_at":"2025-04-09T21:51:24.260Z","avatar_url":"https://github.com/logica0419.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# resigif\n\n[![CI Pipeline](https://github.com/logica0419/resigif/actions/workflows/ci.yml/badge.svg)](https://github.com/logica0419/resigif/actions/workflows/ci.yml) [![Go Reference](https://pkg.go.dev/badge/github.com/logica0419/resigif.svg)](https://pkg.go.dev/github.com/logica0419/resigif) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/logica0419/resigif/blob/main/LICENSE)\n\nAnimated GIF resizing library w/o cgo nor any third-party Libraries\n\n## Installation\n\nYou can install resigif with the `go get` command\n\n```sh\ngo get -u github.com/logica0419/resigif\n```\n\n## Quick Start\n\nThe only API of this library is `Resize()` function.  \nYou can easily resize an animated GIF image by passing `*gif.GIF` struct and the target size.\n\nHere's a simple example:\n\n```go\npackage main\n\nimport (\n  \"context\"\n  \"image/gif\"\n  \"os\"\n\n  \"github.com/logica0419/resigif\"\n)\n\nfunc main() {\n  ctx := context.Background()\n\n  src, err := os.Open(\"image.gif\")\n  if err != nil {\n    panic(err)\n  }\n  defer src.Close()\n\n  srcImg, err := gif.DecodeAll(src)\n  if err != nil {\n    panic(err)\n  }\n\n  width := 480\n  height := 360\n\n  dstImg, err := resigif.Resize(ctx, srcImg, width, height)\n  if err != nil {\n    panic(err)\n  }\n\n  dst, err := os.OpenFile(\"resized.gif\", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o644)\n  if err != nil {\n    panic(err)\n  }\n  defer dst.Close()\n\n  err = gif.EncodeAll(dst, dstImg)\n  if err != nil {\n    panic(err)\n  }\n}\n\n```\n\n## Customization\n\n- Aspect Ratio Preservation\n  - You can choose from `Ignore` or `Maintain`\n\n```go\ndstImg, err := resigif.Resize(\n  ctx,\n  srcImg,\n  width,\n  height,\n  resigif.WithAspectRatio(resigif.Maintain),\n)\n\ndstImg, err := resigif.Resize(\n  ctx,\n  srcImg,\n  width,\n  height,\n  resigif.WithAspectRatio(resigif.Ignore),\n)\n```\n\n- Resizing algorithm\n  - You can use you own resizing algorithm by implementing `ImageResizeFunc` interface and passing it to `WithImageResizeFunc()`\n  - If you want to use `golang.org/x/image/draw.Scaler`, you can use `FromDrawScaler()` to convert it to `ImageResizeFunc`\n\n```go\ndstImg, err := resigif.Resize(\n  ctx,\n  srcImg,\n  width,\n  height,\n  resigif.WithImageResizeFunc(resigif.FromDrawScaler(draw.BiLinear)),\n)\n```\n\n- Parallelism\n  - You can control the number of goroutine used for resizing by passing `WithParallel()`\n\n```go\ndstImg, err := resigif.Resize(\n  ctx,\n  srcImg,\n  width,\n  height,\n  resigif.WithParallel(3),\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogica0419%2Fresigif","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogica0419%2Fresigif","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogica0419%2Fresigif/lists"}