https://github.com/postmodern/pix_fmt.cr
A Crystal library for working with different pixel formats, such as RGB, RGBA, HSL, HSV, YUV, and YUYV.
https://github.com/postmodern/pix_fmt.cr
buffer crystal pixel pixfmt wip
Last synced: about 1 year ago
JSON representation
A Crystal library for working with different pixel formats, such as RGB, RGBA, HSL, HSV, YUV, and YUYV.
- Host: GitHub
- URL: https://github.com/postmodern/pix_fmt.cr
- Owner: postmodern
- License: mit
- Created: 2021-03-16T10:12:00.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-10T10:07:57.000Z (almost 5 years ago)
- Last Synced: 2025-01-15T02:33:31.240Z (about 1 year ago)
- Topics: buffer, crystal, pixel, pixfmt, wip
- Language: Crystal
- Homepage:
- Size: 36.1 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# pix_fmt.cr
A [Crystal] library for working with different pixel formats, such as RGB, RGBA,
BGR, HSL, HSV, HSVA, YUV, and YUYV.
## Features
* RGB / RGBA
* BGR
* HSV / HSVA
* HSL
* YUV
* YUYV
## Installation
1. Add the dependency to your `shard.yml`:
```yaml
dependencies:
pixel:
github: postmodern/pix_fmt
```
2. Run `shards install`
## Usage
```crystal
require "pix_fmt/rgb"
pix = PixFmt::RGB.new(0,255,0)
yuyv_pix = pix.to_yuyv
```
## TODO
* Add arithmetic operation functions.
* Add a YUYV -> RGB conversion function.
* Add a RGB -> YUYV conversion function.
* Add a HSL -> RGB conversion function.
* Add a HSV -> RGB conversion function.
## Contributing
1. Fork it ()
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
## Contributors
- [Postmodern](https://github.com/postmodern) - creator and maintainer
[Crystal]: https://crystal-lang.org/