zignal 0.9.0
Breaking Changes
All color types are generic on the backing scalar: we can now have:
- Rgb(u8), where each channel ranges from 0-255
- Rgb(f32) or Rgb(f64) where each channel is assumed to be in the 0-1 range.
- The rest of color spaces are also generic on float types: Hsv(f32), Hsv(f64)...
- A new Gray(u8/f32/f64) type to make the API more uniform
As a result code that used to look like
Image(u8) => Image(Gray(u8));
Image(Rgb) => Image(Rgb(u8));
Also, color conversions, which used to be:
const rgb: Rgb = .black;
rgb.toHsv().toRgb()'
Are now:
const rgb: Rgb(u8) = .black;
rgb.as(f32).to(.hsv).to(.rgb).as(.u8);
While it's a bit more verbose, we can now specify the backing scalar (which we are forced to do when moving from an integer-based color space into a floating-point-based one.
After this change, Zignal color operations can now compile into SPIR-V.
What's Changed
- ci: update macOS runners in CI matrix by @arrufat in https://github.com/bfactory-ai/zignal/pull/231
- feat(hull): add bounding box accessor by @arrufat in https://github.com/bfactory-ai/zignal/pull/232
- fix(png): validate critical chunk ordering by @arrufat in https://github.com/bfactory-ai/zignal/pull/233
- feat: enforce resource limits in image loading by @arrufat in https://github.com/bfactory-ai/zignal/pull/234
- ci(zig): update zig version to master by @arrufat in https://github.com/bfactory-ai/zignal/pull/236
- refactor: colorgate by @arrufat in https://github.com/bfactory-ai/zignal/pull/237
- feat(matrix): add method to convert matrix element type by @arrufat in https://github.com/bfactory-ai/zignal/pull/238
- feat(geometry/transforms): add scalar type conversion methods by @arrufat in https://github.com/bfactory-ai/zignal/pull/239
- refactor(geometry): remove allocator field from transform structs by @arrufat in https://github.com/bfactory-ai/zignal/pull/240
- fix(wheels): use explicit zig targets instead of native by @arrufat in https://github.com/bfactory-ai/zignal/pull/241
- refactor(python): simplify color type object generation by @arrufat in https://github.com/bfactory-ai/zignal/pull/242
- refactor(python): validate color component range (0-255) by @arrufat in https://github.com/bfactory-ai/zignal/pull/243
- feat(py): add sequence conversion and improve memory error handling by @arrufat in https://github.com/bfactory-ai/zignal/pull/244
- refactor(color): generalize scalar color handling to all floats by @arrufat in https://github.com/bfactory-ai/zignal/pull/245
- refactor(python): rename Grayscale dtype to Gray by @arrufat in https://github.com/bfactory-ai/zignal/pull/246
Full Changelog: https://github.com/bfactory-ai/zignal/compare/0.8.0...0.9.0