{"id":15628270,"url":"https://github.com/kagami/go-avif","last_synced_at":"2025-04-05T13:08:59.569Z","repository":{"id":38291776,"uuid":"176097677","full_name":"Kagami/go-avif","owner":"Kagami","description":":art: Go AVIF library","archived":false,"fork":false,"pushed_at":"2022-09-16T07:18:10.000Z","size":40,"stargazers_count":328,"open_issues_count":12,"forks_count":20,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-29T12:10:27.664Z","etag":null,"topics":["av1","avif","cli","golang","image-compression"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kagami.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":"https://www.blockchain.com/btc/payment_request?address=3LKKbbi34MHYRQSLV3ZiDGoKgUmCjhTumT\u0026message=Kagami+open+source+projects+support"}},"created_at":"2019-03-17T12:26:13.000Z","updated_at":"2025-03-26T21:33:33.000Z","dependencies_parsed_at":"2022-07-16T23:30:39.121Z","dependency_job_id":null,"html_url":"https://github.com/Kagami/go-avif","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kagami%2Fgo-avif","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kagami%2Fgo-avif/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kagami%2Fgo-avif/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kagami%2Fgo-avif/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kagami","download_url":"https://codeload.github.com/Kagami/go-avif/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339158,"owners_count":20923014,"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":["av1","avif","cli","golang","image-compression"],"created_at":"2024-10-03T10:21:43.746Z","updated_at":"2025-04-05T13:08:59.546Z","avatar_url":"https://github.com/Kagami.png","language":"Go","funding_links":["https://www.blockchain.com/btc/payment_request?address=3LKKbbi34MHYRQSLV3ZiDGoKgUmCjhTumT\u0026message=Kagami+open+source+projects+support"],"categories":[],"sub_categories":[],"readme":"# go-avif [![Build Status](https://travis-ci.org/Kagami/go-avif.svg?branch=master)](https://travis-ci.org/Kagami/go-avif) [![GoDoc](https://godoc.org/github.com/Kagami/go-avif?status.svg)](https://godoc.org/github.com/Kagami/go-avif)\n\ngo-avif implements\nAVIF ([AV1 Still Image File Format](https://aomediacodec.github.io/av1-avif/))\nencoder for Go using libaom, the [high quality](https://github.com/Kagami/av1-bench)\nAV1 codec.\n\n## Requirements\n\nMake sure libaom is installed. On typical Linux distro just run:\n\n#### Debian (and derivatives):\n```bash\nsudo apt-get install libaom-dev\n```\n\n#### RHEL (and derivatives):\n```bash\nsudo dnf install libaom-devel\n```\n\n## Usage\n\nTo use go-avif in your Go code:\n\n```go\nimport \"github.com/Kagami/go-avif\"\n```\n\nTo install go-avif in your $GOPATH:\n\n```bash\ngo get github.com/Kagami/go-avif\n```\n\nFor further details see [GoDoc documentation](https://godoc.org/github.com/Kagami/go-avif).\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"image\"\n\t_ \"image/jpeg\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/Kagami/go-avif\"\n)\n\nfunc main() {\n\tif len(os.Args) != 3 {\n\t\tlog.Fatalf(\"Usage: %s src.jpg dst.avif\", os.Args[0])\n\t}\n\n\tsrcPath := os.Args[1]\n\tsrc, err := os.Open(srcPath)\n\tif err != nil {\n\t\tlog.Fatalf(\"Can't open sorce file: %v\", err)\n\t}\n\n\tdstPath := os.Args[2]\n\tdst, err := os.Create(dstPath)\n\tif err != nil {\n\t\tlog.Fatalf(\"Can't create destination file: %v\", err)\n\t}\n\n\timg, _, err := image.Decode(src)\n\tif err != nil {\n\t\tlog.Fatalf(\"Can't decode source file: %v\", err)\n\t}\n\n\terr = avif.Encode(dst, img, nil)\n\tif err != nil {\n\t\tlog.Fatalf(\"Can't encode source image: %v\", err)\n\t}\n\n\tlog.Printf(\"Encoded AVIF at %s\", dstPath)\n}\n```\n\n## CLI\n\ngo-avif comes with handy CLI utility `avif`. It supports encoding of JPEG and\nPNG files to AVIF:\n\n```bash\n# Compile and put avif binary to $GOPATH/bin\ngo get github.com/Kagami/go-avif/...\n\n# Encode JPEG to AVIF with default settings\navif -e cat.jpg -o kitty.avif\n\n# Encode PNG with slowest speed\navif -e dog.png -o doggy.avif --best -q 15\n\n# Lossless encoding\navif -e pig.png -o piggy.avif --lossless\n\n# Show help\navif -h\n```\n\nStatic 64-bit builds for Windows, macOS and Linux are available at\n[releases page](https://github.com/Kagami/go-avif/releases). They include\nlatest libaom from git at the moment of build.\n\n## Display\n\nTo display resulting AVIF files take a look at software listed\n[here](https://github.com/AOMediaCodec/av1-avif/wiki#demuxers--players). E.g.\nuse [avif.js](https://kagami.github.io/avif.js/) web viewer.\n\n## License\n\ngo-avif is licensed under [CC0](COPYING).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkagami%2Fgo-avif","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkagami%2Fgo-avif","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkagami%2Fgo-avif/lists"}