NPL Dardana
The official site for a Kosovo municipality's public utility: services, leadership, and required documents.
- statically exported pages
- 27
- official documents re-encoded
- 21.3 → 3.4 MB
- measured contrast on the primary colour
- 9.18:1
The problem
A municipal public enterprise had no web presence carrying the material its citizens — and its own statute — require: address, hours, who runs it, the statute, the organogram, annual and quarterly reports, the legal framework. The source documents existed only as printed, signed, stamped paper, scanned back into 5 to 8 MB PDFs far too heavy to put behind a download link.
What I built
A 27-page statically exported site in Albanian, structured so Serbian and English can be added without a refactor. No user-facing string sits in the markup — everything resolves through a translation catalogue, so a new language is a new file plus one line. Static export is a deliberate constraint that keeps inexpensive shared hosting viable, which in turn rules out server actions and the image optimiser and pushes list filtering to the client.
The design system is derived rather than chosen. Brand colours were sampled from the supplied logo artwork, and where each one may be used is decided by measured contrast: the primary green at 9.18:1 on white is the only text and button colour, a second green at 4.33:1 is decorative only, and the bright accent at 1.32:1 is restricted to dark surfaces. The logo is not hand-drawn — a Python script traces it from the source artwork and the result is verified against the source mask at under 5% pixel deviation.
Two things are deliberately absent rather than unfinished. The client supplied CVs; the biographies that had been inferred from them were deleted, and only names and roles are published, with the data layer filtering unconfirmed appointments so one cannot leak even if a component forgets to check. And photography is a labelled placeholder at the correct aspect ratio, so nothing shifts when real files arrive and the page doubles as the shot list.
The hard part
Encode each scanned page for what it holds
Ninety-six pages arrived as full-page colour scans at around 400 KB each. Re-encoding them as JPEG barely helps, and the measurement shows why: on one page, grayscale at quality 70 still cost 313 KB of the original 401 KB. The bits were not going into the text. They were going into paper grain.
So the pipeline classifies every page and encodes it for its content. Four pages of the ninety-six carry colour ink — a stamp or a signature, the marks that make a scan evidence of a signed document — and stay full-resolution colour. Two covers carry an aerial photograph and stay grayscale, because a photograph turns to dithered mush in one bit. The remaining ninety are binarised to CCITT Group 4 at roughly 45 KB a page. Local adaptive thresholding is used rather than a global one, because these pages have grey fills behind the table headers and a grey banner across the top that a global threshold turns into solid blocks. The documented cost is that the banner's gradient degrades — accepted only because its content repeats on every page, in the filename and in the title, so nothing unique is lost, while the body text comes out sharper than the original once the grain is gone.
Outcome
- 27 pages exported and deployed, in Albanian, with the localisation seam already in place for Serbian and English.
- Five official documents published at web weight — 21.3 MB of client scans re-encoded to 3.4 MB.
- Colour usage fixed by measured contrast ratios rather than preference, with the 4.33:1 brand green demoted to decorative use only.
- The review surfaced an unmet statutory obligation the client had not asked about: their own statute requires a single printable section for audit reports, major contracts and top suppliers.
Want something like this built? I take on a small number of projects at a time.