DEV Community

Cover image for HakoNyans: A Transparent Lossless Codec Challenge (with GitHub Copilot CLI)
CharmPic
CharmPic

Posted on

HakoNyans: A Transparent Lossless Codec Challenge (with GitHub Copilot CLI)

GitHub Copilot CLI Challenge Submission

This is a submission for the GitHub Copilot CLI Challenge

What I Built

I built HakoNyans, an experimental image codec focused on practical decode speed and transparent lossless results
across different image types (photo, anime, UI/screen).

For this challenge, I focused on two things:

  1. A clearer lossless workflow in CLI

    • Added a new command:
    • hakonyans encode-lossless <in.ppm> <out.hkn> [preset: fast|balanced|max]
    • This makes lossless testing reproducible from the terminal without custom scripts.
  2. Reproducible visual and metric snapshots

    • Prepared a dedicated asset pack for challenge demos:
    • docs/assets/devchallenge_2026_01_21/
    • Included side-by-side comparisons and both win and lose cases (to keep reporting honest).

What this project means to me:

  • I wanted to show not just “best-case screenshots,” but a realistic engineering snapshot:
  • where HKN already wins (some natural-photo cases), and where PNG is still much stronger (some structured/UI-like cases).

Demo

Screenshots

Main comparison
Artoria side-by-side compare

Lossless win case (nature_01)
Lossless win case

Lossless lose case (hd_01)
Lossless lose case

Example metrics snapshot (fixed6, max preset)

  • nature_01: HKN 812,567 bytes vs PNG 1,281,481 bytes (PNG/HKN = 1.577)
  • nature_02: HKN 999,685 bytes vs PNG 1,446,470 bytes (PNG/HKN = 1.447)
  • hd_01: HKN 710,888 bytes vs PNG 8,785 bytes (PNG/HKN = 0.012)

So currently:

  • HKN can beat PNG on some photo-like content.
  • PNG still dominates some structured/worst-case images.
  • The project is actively improving both sides.

My Experience with GitHub Copilot CLI

GitHub Copilot CLI was most useful for my fast implementation loop:

  • Refactoring large headers into smaller units safely
  • Adding a new CLI command (encode-lossless) while preserving existing behavior
  • Running repetitive verify loops quickly (build, ctest, benchmark checks)
  • Generating and validating challenge-ready visual assets from command pipelines

The biggest impact was speed + consistency:
I could iterate quickly in terminal-first workflows while keeping changes verifiable (tests, checksums, RMSE checks,
benchmark CSVs).


Attribution note used in demo assets
Source: Fate series (Character: Artoria Pendragon), illustration by Takeuchi Takashi

Top comments (0)