Skip to content
Bf27cf5473c8aa99f9802add0c36d765b7015620

Bf27cf5473c8aa99f9802add0c36d765b7015620

github.com • November 28, 2026

Media Optimization Engineer (MOE) is a reusable Django/Python package for image optimization, responsive delivery, and 360-degree media processing.

The public package is intentionally application-agnostic. It does not depend on any consuming project's themes, tenants, brands, business models, or private infrastructure.

automatic ImageField / FileField integration;

AVIF, WebP and JPEG derivatives;

responsive width sets;

semantic profiles such as avatar, card, hero, and default;

focal-point aware crops;

dominant color, BlurHash and lightweight placeholders;

SHA-256 deduplication;

local, S3-compatible and Cloudflare R2 storage;

Redis/Celery processing when enabled;

CDN-ready derivative URLs;

Django template tags for responsive rendering.

bounded audio upload validation with ffprobe;

SHA-256 deduplication and immutable originals;

a reusable audio.invitation profile;

browser-safe MP3 derivatives at a compact default bitrate;

Celery/inline processing through the same autonomous pipeline;

manifest delivery with duration, bitrate and optimized URL;

ffmpeg/ffprobe are the only system-level runtime requirements for audio processing.

equirectangular panorama support;

multiresolution pyramids;

tiled AVIF/WebP delivery;

Pannellum, Marzipano and Three.js adapters;

optional cubemap generation.

Django template rendering

For normal model fields, use the high-level media_image tag:

MOE resolves the field's MediaBinding, generates a responsive picture with available AVIF/WebP sources, preserves the image's CSS classes, and falls back to the original field URL only when no processed binding is available.

For invitation soundtracks, ingest the upload with profile="audio.invitation" and media_kind="audio" . The returned manifest exposes a compact MP3 fallback suitable for an HTML element.

Direct binding rendering

Advanced integrations can render a known asset directly:

For Open Graph metadata, CSS backgrounds, emails, or APIs where picture is not possible:

For normal page images, prefer media_image over media_url; the browser can make a better final choice from srcset and sizes.

MOE provides width descriptors and sizes. The browser chooses the final resource using layout width, viewport, DPR, supported formats, and its own network heuristics.

JavaScript is not required for normal responsive images.

Runtime measurement is appropriate only for highly dynamic components whose rendered width cannot be described reliably with sizes, such as resizable editors, canvas-like builders, or asynchronously mounted panels.

The standalone service is also published as a multi-architecture GHCR image:

For Compose deployment, see docs/DOCKER.md and docker-compose.ghcr.yml .

Flutter / native clients

MOE also ships reference Dart adapters for native applications.

Standard Flutter clients should fetch the image manifest, measure the rendered widget width, multiply it by device pixel ratio, and select the first derivative at or above that physical width.

Reference adapters are packaged under:

This keeps optimization and derivative generation on the Django/Python backend while allowing Flutter to select and cache the most appropriate immutable URL. Panorama manifests use the same principle at tile/level granularity.

Install the extra, then bind a PDF field like an image field:

A reader can show the page pictures at once and the PDF itself once it arrives. The original file is kept as it was.

Historical media can be ingested with maintenance commands:

New uploads registered in MEDIA_ENGINE_AUTO_FIELDS are handled automatically.

Embedded Django mode and standalone-node mode are autonomous. Optional control-plane synchronization must never be required for upload, processing, rendering, or derivative delivery.

MIT License. Copyright (c) 2026 Achille Kabasele.

Progressive panorama publication

The 1.5 release candidate adds immutable revisions, early preview/base publication, validated manifests and staged processing. See the rollout guide .