https://github.com/sergeymakinen/go-ico
ICO and CUR file decoders and encoders
https://github.com/sergeymakinen/go-ico
cur cursor decoder encoder go golang ico icon windows
Last synced: 2 months ago
JSON representation
ICO and CUR file decoders and encoders
- Host: GitHub
- URL: https://github.com/sergeymakinen/go-ico
- Owner: sergeymakinen
- License: bsd-3-clause
- Created: 2024-01-06T11:06:05.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-06T11:29:12.000Z (over 1 year ago)
- Last Synced: 2025-04-02T04:37:06.967Z (3 months ago)
- Topics: cur, cursor, decoder, encoder, go, golang, ico, icon, windows
- Language: Go
- Homepage:
- Size: 180 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ico
[](https://github.com/sergeymakinen/go-ico/actions?query=workflow%3Atests)
[](https://pkg.go.dev/github.com/sergeymakinen/go-ico)
[](https://goreportcard.com/report/github.com/sergeymakinen/go-ico)
[](https://codecov.io/gh/sergeymakinen/go-ico)Package ico implements an ICO file decoder and encoder.
Package cur implements a CUR file decoder and encoder.See https://en.wikipedia.org/wiki/ICO_(file_format) for more information.
## Installation
Use go get:
```bash
go get github.com/sergeymakinen/go-ico
```Then import the package into your own code:
```go
import "github.com/sergeymakinen/go-ico"
```## Example
```go
b, _ := os.ReadFile("icon_32x32-32.png")
m1, _ := png.Decode(bytes.NewReader(b))
b, _ = os.ReadFile("icon_256x256-32.png")
m2, _ := png.Decode(bytes.NewReader(b))
f, _ := os.Create("icon.ico")
ico.EncodeAll(f, []image.Image{m1, m2})
f.Close()
```## License
BSD 3-Clause