You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Difficulty: Easy (good first issue) Mentorship: Yes — comment on this issue or start a thread in GitHub Discussions for guidance and code review. Contribution Guidelines: Please see CONTRIBUTING.md (dual-licensed under MIT OR Apache-2.0, no CLA required).
What Is Asked
crates/oxideon-core/src/image_codec.rs already provides zero-dependency pure-Rust PNG and JPEG decoding (decode_png, decode_jpeg, decode_image_tensor, load_image) so core tensor code does not depend on external image crates or Pillow.
We want to add:
Pure-Rust PNG encoding (encode_png and save_image).
Indexed-palette (color_type = 3 with PLTE + optional tRNS) and 16-bit PNG support in decode_png.
decode_png decodes palette (PLTE) and 16-bit PNGs without errors.
Round-trip unit tests (encode_png -> decode_png) pass in cargo test -p oxideon-core --lib image_codec.
Implementation Guidance
image_codec.rs already has CRC-32 and Adler-32 helpers in its test module (crc32, adler32) that can be promoted for shared use by the encoder.
For initial PNG encoding, stored DEFLATE blocks or a simple zlib wrapper + PNG IHDR / IDAT / IEND chunk writer keeps the implementation clean, zero-dependency, and fast to verify.
For palette PNGs (color_type = 3), parse the PLTE chunk (3 * N RGB bytes) and map each index byte cleanly in the scanline pass.
Activity
feat(image_codec): add pure-Rust PNG encoder (encode_png / save_image)