SDR logo PNG → glowing HDR JPEG for Apple Preview, Safari, Photos, and Chrome.
Turn a transparent logo into an HDR image that literally lights up on HDR displays — the same effect you see in modern brand icons on MacBooks and iPhones.
git clone https://github.com/masicmirza/HDRGlow.git
cd HDRGlow
pip install -r requirements.txt
# Recommended on Mac: PNG with Rec.2020 PQ ICC (glows + clean edges)
python main.py logo.png logo_hdr.png --background "#ffffff"Open logo_hdr.png in Preview or Safari on an HDR display.
| Format | Glow on Mac | SDR edges | Notes |
|---|---|---|---|
.png (default) |
Yes | Best | Use this |
.jpg (--format retag) |
Yes | Softer | JPEG ringing on thin strokes |
.heic |
Often no | Good | Skip for glow |
ultrahdr |
Often no | Sharp | Gain map not applied by Preview |
| Requirement | Detail |
|---|---|
| Format | PNG (RGBA preferred) |
| Background | Transparent — the tool composites onto --background |
| Size | Any; use --supersampling 2 for logos under ~200px |
Export from Figma / Sketch / Illustrator as PNG with transparency.
# Minimal (recommended for most logos)
python main.py input.png output.jpg --background "#36185A"
# With edge cleanup
python main.py input.png output.jpg --background "#36185A" --remove-noise
# Inspect an HDR JPEG
python main.py inspect output.jpg
# Compare multiple peak-brightness targets
python main.py test-outputs input.png --output-dir ./test_outputs| Flag | Default | Description |
|---|---|---|
--background |
#000000 |
Background colour under transparency (hex) |
--format |
png |
png (glow + clean edges), retag (JPEG glow), heic (often no glow), ultrahdr, pq |
--quality |
95 |
JPEG quality (1–95) |
--remove-noise |
off | Strip near-white fringe pixels on alpha edges |
--enhance-edges |
off | Unsharp mask for sharper logo edges |
--supersampling N |
1 |
Upsample small logos by N× before processing |
--brightness |
3.0 |
Linear luminance boost (pq / apple only) |
--white-nits |
1000 |
Peak white in nits (pq / apple only) |
--contrast |
1.15 |
Contrast (pq / apple only) |
--saturation |
1.08 |
Saturation (pq / apple only) |
--gamma |
auto |
Gamma correction (pq / apple only) |
-v |
off | Debug logging |
| Format | What it does | Best for |
|---|---|---|
png (default) |
sRGB pixels + Rec.2020 PQ ICC in a PNG | Mac HDR glow + clean edges |
retag |
Same idea as JPEG | When you must use .jpg |
heic |
Rec.2020 PQ NCLX HEIC | Often no glow in Preview — avoid |
ultrahdr |
Sharp sRGB base + Ultra HDR gain map | Android/Chrome gain-map viewers |
pq |
Full linear-light → Rec.2020 → PQ JPEG | Professional HDR pipelines |
PNG (RGBA)
→ load + optional cleanup
→ composite onto background
→ export as JPEG with Rec.2020 PQ ICC profile
The default retag mode matches how many real-world HDR brand logos are authored: sRGB codes are stored as-is, and an Apple Rec.2020 PQ ICC profile tells HDR displays to interpret them as PQ luminance — so mid-greys become ~1000+ nits on screen.
Optional modes (pq, apple) implement proper colour-science and gain-map pipelines for later formats (Ultra HDR, AVIF, JXL, HEIC).
pip install pytest
python -m pytest tests/ -vHDRGlow/
main.py CLI entry point
pipeline/
loader.py PNG → float32 RGBA
compositor.py Alpha composite + sRGB ↔ linear
hdr.py Rec.2020, boost, PQ encoding
tone_mapping.py SDR preview operators
gainmap.py Gain map computation
icc.py ICC profile load / inspect
export.py retag / Apple / PQ exporters
profiles/ Rec.2020 PQ ICC profile
tests/ Unit + integration tests
MIT — see LICENSE.
The bundled ICC profile in profiles/ is an Apple Rec.2020 PQ profile used for display compatibility. Apple trademarks remain Apple’s.