Cover, Certificate, Acknowledgement, Index
Universal pages prepended when printing from /. Title, programme, Submitted by / to, school, university, location, date · all the fields the practical-file rubric expects.
Work / Research / DIP Practical Handbook
Most practical handbooks are PDFs nobody can run. Students copy code that does not compile, hate the subject, and graduate without a portfolio. This handbook ships eight Gonzalez & Woods experiments, each in three independently-runnable forms · Jupyter, Flask on Cloud Run, static Cloudflare Pages · plus a print-ready Chicago-style PDF with cover, certificate, index, QR codes and watermark.
Act I · The Syllabus
The full prescribed list, end to end. Every entry runs in three places, and every entry prints to a colour-coded section template.
Act II · The Matrix
A student opens Colab. A teacher demos it on the projector through the Cloud Run app. An evaluator with no internet opens the static folder. All three see the same experiment, with the same colour-coded sections.
| # | Experiment | Jupyter | Flask · Cloud Run | Static · Cloudflare |
|---|---|---|---|---|
| 1 | Display | Y | Y | Y |
| 2 | Sampling | Y | Y | Y |
| 3 | Negation / Subtract | Y | Y | Y |
| 4 | Gamma / Power law | Y | Y | Y |
| 5 | Equalization | Y | Y | Y |
| 6 | Matching | Y | Y | Y |
| 7 | Conv / Corr | Y | Y | Y |
| 8 | Spatial filtering | Y | Y | Y |
8 experiments · 3 runtimes · 24 independent paths
Act III · The Handbook
Every page on the live site is print-ready. The PDF is Chicago-style, AAA-accessible, and matches the Shoolini practical-file template exactly.
Universal pages prepended when printing from /. Title, programme, Submitted by / to, school, university, location, date · all the fields the practical-file rubric expects.
"Practical 7: 2D Correlation & Convolution" appears when printing an individual practical, suppressed on the consolidated home printout. One template, both modes.
Aim (blue), Description / Theory (purple), Code (green), Output (orange), Analysis / Conclusion (red). Identical palette across notebooks and the web app.
The exact Python from the notebooks is embedded in the Code block, not the server processors · so the printed code matches what the student actually ran.
A beforeprint JS hook copies every visible figure into the Output container, so what is on screen ends up on paper.
QR on each cover encodes the canonical page URL (works behind Cloudflare via Werkzeug ProxyFix). Centred dmj.one watermark on every content page, suppressed on the cover.
1.1, 1.2, …, 8.5 using CSS named-page contexts. Cover unnumbered. Times New Roman 12pt, justified, 1-inch margins. JetBrains Mono code blocks.
precompute.py runs at Docker build time. Pages render instantly on first hit, and printed PDFs include the figures even before the user clicks anything.
Chapters 02 and 03 are fetched from imageprocessingplace.com on first run, then cached locally. The Colab notebooks do the same so they run end-to-end with one click.
The Stack
Act IV · Proof
Production deployment behind Cloudflare. Werkzeug ProxyFix honours X-Forwarded-* only from the Cloud Run / Cloudflare hop. Custom domain, HSTS preloaded.
gcloud run deploy dip-practical --source . --region asia-south1 --memory 2Gi --allow-unauthenticated. The Dockerfile runs precompute.py at build time so the image ships with all 32 cached figures.
autoconfig.sh installs Python, Nginx (with microcache), systemd unit, log rotation, UFW rules on a fresh Ubuntu 24.04 host. Deterministic from start to finish.
The pages/ folder re-implements every operation in pure JavaScript via the Canvas API. Deploy to Cloudflare Pages or GitHub Pages with no backend at all.
I build teaching artefacts that ship as real systems · runnable in three places, accessible to every reader, ready for submission, ready for production.