Files
Odin/core
Jeroen van Rijn e0f3a03bbf core:image/png: Add PNG saving and fixes/adds core:image helpers
`core:image/png`:
- New `save` (`save_to_buffer`, `save_to_file`)
  - Supports G, GA, RGB, RGBA in 8 and 16 bit per channel.
  - Writes IHDR, one IDAT and IEND; metadata is left for a later PR.
- Defaults: Deflate level 5 and the `.Adaptive` per-row filter heuristic.
  - `.None`, `.Sub`, `.Up`, `.Average` or `.Paeth` also available.
- Speed at the defaults: about 85 MB/s (5950X) and 110 MB/s (M4) of
  raw pixels; Deflate is about 95% of that time.
- Size: on 16-bit RGBA test images the default is 3-12% smaller than
  libpng's default level 6. Level 9 matches libpng -9 to the byte on
  the 1024x1024 Odin logo.
- Fix: paletted images with `tRNS` loaded with only `.alpha_premultiply`
  returned 4 channels of packed RGB.
- Fix: premultiplied palette entries passed `blend` its arguments in
  the wrong order, turning opaque entries black.

`core:image`:
- Helper procedures move from `common.odin` to `helpers.odin`.
- New typed pixel views: `to_gray`, `to_ga`, `to_rgb`, `to_rgba` and
  their 16-bit variants, taking a `^image.Image`,
  and returning e.g. `[]RGB_Pixel`.
- Fix: `return_single_channel` used the 1-based `Channel` as a 0-based
  index, so R returned G and A read past the pixel.
- Fix: `blend` swapped its weights and masked instead of shifting, so
  it was only right at alpha 0 and 255.
2026-11-02 12:47:42 +01:00
..
2026-10-26 16:02:20 +03:00
2026-09-24 10:02:36 +02:00
2026-10-31 22:11:50 +01:00
2026-08-02 03:15:30 +02:00
2026-04-28 19:27:24 +02:00
2026-07-30 12:03:08 +02:00