{"id":19450364,"url":"https://github.com/jackmordaunt/icns","last_synced_at":"2025-09-05T11:21:09.565Z","repository":{"id":29338089,"uuid":"121253862","full_name":"JackMordaunt/icns","owner":"JackMordaunt","description":"Easily create .icns files (Mac Icons) with this Go library or the included CLI. ","archived":false,"fork":false,"pushed_at":"2024-10-29T04:25:27.000Z","size":212,"stargazers_count":89,"open_issues_count":3,"forks_count":6,"subscribers_count":2,"default_branch":"v3","last_synced_at":"2025-08-14T01:47:51.440Z","etag":null,"topics":["cli","go","golang","icns","icons","iconset","iconutil","library","macos","osx","retina"],"latest_commit_sha":null,"homepage":"https://liberapay.com/JackMordaunt","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/JackMordaunt.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":"2018-02-12T14:05:28.000Z","updated_at":"2025-07-22T19:50:38.000Z","dependencies_parsed_at":"2023-11-18T00:13:29.994Z","dependency_job_id":"0ab21ee2-5f52-4fbd-9cea-932446317d76","html_url":"https://github.com/JackMordaunt/icns","commit_stats":{"total_commits":111,"total_committers":8,"mean_commits":13.875,"dds":0.3063063063063063,"last_synced_commit":"fc8699534bd85cf23bbce098bce8d768adca85f6"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/JackMordaunt/icns","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JackMordaunt%2Ficns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JackMordaunt%2Ficns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JackMordaunt%2Ficns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JackMordaunt%2Ficns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JackMordaunt","download_url":"https://codeload.github.com/JackMordaunt/icns/tar.gz/refs/heads/v3","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JackMordaunt%2Ficns/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273748686,"owners_count":25160884,"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","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cli","go","golang","icns","icons","iconset","iconutil","library","macos","osx","retina"],"created_at":"2024-11-10T16:37:01.585Z","updated_at":"2025-09-05T11:21:09.514Z","avatar_url":"https://github.com/JackMordaunt.png","language":"Go","funding_links":["https://liberapay.com/JackMordaunt"],"categories":[],"sub_categories":[],"readme":"# icns\n\nEasily convert `.jpg` and `.png` to `.icns` with the command line tool `icnsify`, or use the library to convert from any `image.Image` to `.icns`.\n\n`go get github.com/jackmordaunt/icns`\n\n`icns` files allow for high resolution icons to make your apps look sexy. The most common ways to generate icns files are:\n\n1. `iconutil`, which is a Mac native cli utility.\n2. `ImageMagick` which adds a large dependency to your project for such a simple use case.\n\nWith this library you can use pure Go to create `icns` files from any source image, given that you can decode it into an `image.Image`, without any heavyweight dependencies or subprocessing required. You can also use it to create icns files on windows and linux (thanks Go).\n\nA small CLI app `icnsify` is provided allowing you to create icns files using this library from the command line. It supports piping, which is something `iconutil` does not do, making it substantially easier to wrap or chuck into a shell pipeline.\n\nNote: All icons within the `icns` are sized for high dpi retina screens, using the appropriate `icns` OSTypes.\n\n## GUI\n\n`preview` is a gui for displaying `icns` files cross-platform.\n\n### Go Tool\n\n```\ngo install github.com/jackmordaunt/icns/cmd/preview@latest\n```\n\n### Clone\n\n```\ngit clone https://github.com/jackmordaunt/icns\ncd icns/cmd/preview \u0026\u0026 go install .\n```\n\nNote: Gio cannot be cross-compiled right now, so there are no `preview` builds in releases.\nNote: `preview` has it's own `go.mod` and therefore is versioned independently (unversioned).\n\n![preview](docs/preview.png)\n\n## Command Line\n\n### Go Tool\n\n```\ngo install github.com/jackmordaunt/icns/cmd/icnsify@latest\n```\n\n### [Scoop](https://scoop.sh/)\n\n```powershell\nscoop bucket add extras # Ensure bucket is added first\nscoop install icnsify\n```\n\nOr from my personal bucket:\n\n```powershell\nscoop bucket add jackmordaunt https://github.com/jackmordaunt/scoop-bucket \nscoop install jackmordaunt/icns # Name is defaulted to repo name. \n```\n\n### [Winget](https://learn.microsoft.com/en-us/windows/package-manager/)\n\n```powershell\nwinget install icnsify\n```\n\n### [Brew](https://brew.sh)\n\n```sh\nbrew tap jackmordaunt/homebrew-tap # Ensure tap is added first.\nbrew install icnsify\n```\n\n### Clone\n\n```\ngit clone https://github.com/jackmordaunt/icns\ncd icns \u0026\u0026 go install ./cmd/icnsify\n```\n\nPipe it\n\n`cat icon.png | icnsify \u003e icon.icns`\n\n`cat icon.icns | icnsify \u003e icon.png`\n\nStandard\n\n`icnsify -i icon.png -o icon.icns`\n\n`icnsify -i icon.icns -o icon.png`\n\n## Library\n\n`go get github.com/jackmordaunt/icns/v3`\n\n```go\nfunc main() {\n        pngf, err := os.Open(\"path/to/icon.png\")\n        if err != nil {\n                log.Fatalf(\"opening source image: %v\", err)\n        }\n        defer pngf.Close()\n        srcImg, _, err := image.Decode(pngf)\n        if err != nil {\n                log.Fatalf(\"decoding source image: %v\", err)\n        }\n        dest, err := os.Create(\"path/to/icon.icns\")\n        if err != nil {\n                log.Fatalf(\"opening destination file: %v\", err)\n        }\n        defer dest.Close()\n        if err := icns.Encode(dest, srcImg); err != nil {\n                log.Fatalf(\"encoding icns: %v\", err)\n        }\n}\n```\n\n## Roadmap\n\n- [x] Encoder: `image.Image -\u003e .icns`\n- [x] Command Line Interface\n  - [x] Encoding\n  - [x] Pipe support\n  - [x] Decoding\n- [x] Implement Decoder: `.icns -\u003e image.Image`\n- [ ] Symmetric test: `decode(encode(img)) == img`\n\n## Coffee\n\nIf this software is useful to you, consider buying me a coffee!\n\n[https://liberapay.com/JackMordaunt](https://liberapay.com/JackMordaunt)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackmordaunt%2Ficns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjackmordaunt%2Ficns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackmordaunt%2Ficns/lists"}