Skip to content

fix: label sizes in KiB and MiB, the units the tool divides by - #64

Merged
nucliweb merged 1 commit into
mainfrom
fix/size-units
Nov 27, 2026
Merged

nucliweb merged 1 commit into
mainfrom
fix/size-units

Conversation

@nucliweb

Copy link
Copy Markdown
Owner

Summary

The comparison table and the HTML report divide file sizes and peak memory by 1024, but labelled them KB and MB. Those are the decimal units a --target-bytes budget such as 50KB (50,000 bytes) is given in, so a 30 KB budget run could show a file as "29.3 KB" when it held 30,000 bytes.

  • The table's size and memory columns, and the report's stats panel, chart labels and takeaway, now read KiB and MiB. The values are unchanged.
  • The README figures copied from tool output are relabelled to match, and the ASCII examples re-padded. Decimal figures (budget-mode text, a dataset's download size) stay as they are.

Testing

  • Unit tests for the table and the report's formatters (they failed before the fix).
  • node --test: 130 pass, 2 codec-gated skips.
  • A CLI run on cid22-friends.png with --html, and the report rendered in headless Chrome: only KiB/MiB figures remain.

The table and the HTML report divided sizes and memory by 1024 but labelled them KB and MB, the decimal units that a --target-bytes budget such as 50KB is given in. They now read KiB and MiB; the figures themselves are unchanged, and the README examples are relabelled to match.
@github-actions

Copy link
Copy Markdown

Codec comparison ✅ no size or quality regression

📥 Download the codec report (unzip and open report.html locally). Available until 2027-02-25, when GitHub deletes the artifact.

Size check
Size regression check (target 90, size tolerance 2.0%, quality tolerance 0.5 ssimulacra2)

  ok         cid22-blossoms.png  JPEG XL  base 105038 → 105038  (+0.00%)  ss2 90.08 → 90.08  (+0.00)
  ok         cid22-blossoms.png  WebP  base 118162 → 118162  (+0.00%)  ss2 76.87 → 76.87  (+0.00)
  ok         cid22-blossoms.png  AVIF  base 128030 → 128030  (+0.00%)  ss2 89.75 → 89.75  (+0.00)
  ok         cid22-blossoms.png  jpegli  base 137045 → 137045  (+0.00%)  ss2 90.11 → 90.11  (+0.00)
  ok         cid22-blossoms.png  mozjpeg  base 164234 → 164234  (+0.00%)  ss2 90.20 → 90.20  (+0.00)
  ok         cid22-blossoms.png  HEIC  base 194761 → 194761  (+0.00%)  ss2 82.22 → 82.22  (+0.00)
  ok         cid22-church.png  JPEG XL  base 61171 → 61171  (+0.00%)  ss2 89.85 → 89.85  (+0.00)
  ok         cid22-church.png  AVIF  base 68127 → 68127  (+0.00%)  ss2 89.73 → 89.73  (+0.00)
  ok         cid22-church.png  HEIC  base 71021 → 71021  (+0.00%)  ss2 90.11 → 90.11  (+0.00)
  ok         cid22-church.png  jpegli  base 78183 → 78183  (+0.00%)  ss2 89.74 → 89.74  (+0.00)
  ok         cid22-church.png  WebP  base 94246 → 94246  (+0.00%)  ss2 88.91 → 88.91  (+0.00)
  ok         cid22-church.png  mozjpeg  base 99280 → 99280  (+0.00%)  ss2 89.89 → 89.89  (+0.00)
  ok         cid22-friends.png  JPEG XL  base 52793 → 52793  (+0.00%)  ss2 89.83 → 89.83  (+0.00)
  ok         cid22-friends.png  AVIF  base 54356 → 54356  (+0.00%)  ss2 89.97 → 89.97  (+0.00)
  ok         cid22-friends.png  jpegli  base 64424 → 64424  (+0.00%)  ss2 89.80 → 89.80  (+0.00)
  ok         cid22-friends.png  HEIC  base 79196 → 79196  (+0.00%)  ss2 90.01 → 90.01  (+0.00)
  ok         cid22-friends.png  WebP  base 87218 → 87218  (+0.00%)  ss2 89.44 → 89.44  (+0.00)
  ok         cid22-friends.png  mozjpeg  base 91561 → 91561  (+0.00%)  ss2 90.25 → 90.25  (+0.00)
  ok         corporate-memphis.png  AVIF  base 19074 → 19074  (+0.00%)  ss2 89.87 → 89.87  (+0.00)
  ok         corporate-memphis.png  JPEG XL  base 44539 → 44539  (+0.00%)  ss2 90.24 → 90.24  (+0.00)
  ok         corporate-memphis.png  WebP  base 46758 → 46758  (+0.00%)  ss2 85.87 → 85.87  (+0.00)
  ok         corporate-memphis.png  HEIC  base 68663 → 68663  (+0.00%)  ss2 88.01 → 88.01  (+0.00)
  ok         corporate-memphis.png  jpegli  base 80411 → 80411  (+0.00%)  ss2 89.92 → 89.92  (+0.00)
  ok         corporate-memphis.png  mozjpeg  base 100129 → 100129  (+0.00%)  ss2 89.62 → 89.62  (+0.00)
  ok         forest-leaves.png  JPEG XL  base 626391 → 626391  (+0.00%)  ss2 89.67 → 89.67  (+0.00)
  ok         forest-leaves.png  HEIC  base 678675 → 678675  (+0.00%)  ss2 89.87 → 89.87  (+0.00)
  ok         forest-leaves.png  jpegli  base 741875 → 741875  (+0.00%)  ss2 89.87 → 89.87  (+0.00)
  ok         forest-leaves.png  WebP  base 753448 → 753448  (+0.00%)  ss2 89.52 → 89.52  (+0.00)
  ok         forest-leaves.png  AVIF  base 824552 → 824552  (+0.00%)  ss2 90.45 → 90.45  (+0.00)
  ok         forest-leaves.png  mozjpeg  base 1119980 → 1119980  (+0.00%)  ss2 89.60 → 89.60  (+0.00)
  ok         pipeline-diagram.png  AVIF  base 62798 → 62798  (+0.00%)  ss2 90.07 → 90.07  (+0.00)
  ok         pipeline-diagram.png  WebP  base 63042 → 63042  (+0.00%)  ss2 73.46 → 73.46  (+0.00)
  ok         pipeline-diagram.png  JPEG XL  base 75252 → 75252  (+0.00%)  ss2 89.83 → 89.83  (+0.00)
  ok         pipeline-diagram.png  HEIC  base 97122 → 97122  (+0.00%)  ss2 73.38 → 73.38  (+0.00)
  ok         pipeline-diagram.png  jpegli  base 113660 → 113660  (+0.00%)  ss2 89.27 → 89.27  (+0.00)
  ok         pipeline-diagram.png  mozjpeg  base 180740 → 180740  (+0.00%)  ss2 89.86 → 89.86  (+0.00)
  ok         report-ui.png  AVIF  base 64121 → 64121  (+0.00%)  ss2 89.82 → 89.82  (+0.00)
  ok         report-ui.png  JPEG XL  base 98049 → 98049  (+0.00%)  ss2 89.61 → 89.61  (+0.00)
  ok         report-ui.png  WebP  base 117598 → 117598  (+0.00%)  ss2 77.40 → 77.40  (+0.00)
  ok         report-ui.png  jpegli  base 169432 → 169432  (+0.00%)  ss2 89.92 → 89.92  (+0.00)
  ok         report-ui.png  HEIC  base 174308 → 174308  (+0.00%)  ss2 83.19 → 83.19  (+0.00)
  ok         report-ui.png  mozjpeg  base 218438 → 218438  (+0.00%)  ss2 90.25 → 90.25  (+0.00)

OK: no size or quality regressions.

@nucliweb
nucliweb merged commit efddd99 into main Nov 27, 2026
2 checks passed
@nucliweb
nucliweb deleted the fix/size-units branch November 27, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant