Skip to content

Debloat any Android or Google TV over Wi-Fi and get an Apple TV-style home.

README: the card goes spooky until 1 Nov (readme_card.py --halloween; docs/card.jpg kept)

Gathin239e9194589929
diff --git a/README.de.md b/README.de.md
index 1273d52f2..93a43f4db 100644
--- a/README.de.md
+++ b/README.de.md
@@ -20,7 +20,7 @@
</p>
<p align="center">
- <a href="docs/PRESS.md"><img src="docs/card.jpg" alt="360 TV-Modelle · 97 Marken · 30 Sprachen · Launcher mit 561 KB. Erwähnt in TechCrunch, TechRadar, Tom's Guide, Mashable, Android Authority, XDA, FlatpanelsHD, It's FOSS, Phandroid, GIGAZINE, Xataka, WinFuture, Frandroid, Macitynet, Techaeris, TechPP und 298 weitere: 314 Artikel aus 44 Ländern. Vorher: der Google-TV-Startbildschirm mit einer bezahlten Anzeige. Nachher: der Clean-Your-TV-Launcher." width="800"></a>
+ <a href="docs/PRESS.md"><img src="docs/card-halloween.jpg" alt="360 TV-Modelle · 97 Marken · 30 Sprachen · Launcher mit 561 KB. Erwähnt in TechCrunch, TechRadar, Tom's Guide, Mashable, Android Authority, XDA, FlatpanelsHD, It's FOSS, Phandroid, GIGAZINE, Xataka, WinFuture, Frandroid, Macitynet, Techaeris, TechPP und 298 weitere: 314 Artikel aus 44 Ländern. Vorher: der Google-TV-Startbildschirm mit einer bezahlten Anzeige. Nachher: der Clean-Your-TV-Launcher." width="800"></a>
</p>
## Einstieg
diff --git a/README.md b/README.md
index 3be139679..753bb2252 100644
--- a/README.md
+++ b/README.md
@@ -24,7 +24,7 @@
</p>
<p align="center">
- <a href="docs/PRESS.md"><img src="docs/card.jpg" alt="360 TV models · 97 brands · 30 languages · 561 KB launcher. Featured in TechCrunch, TechRadar, Tom's Guide, Mashable, Android Authority, XDA, FlatpanelsHD, It's FOSS, Phandroid, GIGAZINE, Xataka, WinFuture, Frandroid, Macitynet, Techaeris, TechPP and 298 more: 314 articles from 44 countries. Before: stock Google TV home with a sponsored ad. After: the Clean Your TV launcher." width="800"></a>
+ <a href="docs/PRESS.md"><img src="docs/card-halloween.jpg" alt="360 TV models · 97 brands · 30 languages · 561 KB launcher. Featured in TechCrunch, TechRadar, Tom's Guide, Mashable, Android Authority, XDA, FlatpanelsHD, It's FOSS, Phandroid, GIGAZINE, Xataka, WinFuture, Frandroid, Macitynet, Techaeris, TechPP and 298 more: 314 articles from 44 countries. Before: stock Google TV home with a sponsored ad. After: the Clean Your TV launcher." width="800"></a>
</p>
## Start here
diff --git a/README.nl.md b/README.nl.md
index 56223cf37..fca1dc883 100644
--- a/README.nl.md
+++ b/README.nl.md
@@ -26,7 +26,7 @@
</p>
<p align="center">
- <a href="docs/PRESS.md"><img src="docs/card.jpg" alt="360 tv-modellen · 97 merken · 30 talen · launcher van 561 KB. Genoemd in TechCrunch, TechRadar, Tom's Guide, Mashable, Android Authority, XDA, FlatpanelsHD, It's FOSS, Phandroid, GIGAZINE, Xataka, WinFuture, Frandroid, Macitynet, Techaeris, TechPP en nog 298 media: 314 artikelen uit 44 landen. Voorheen: het standaard Google TV-startscherm met een gesponsorde advertentie. Daarna: de Clean Your TV-launcher." width="800"></a>
+ <a href="docs/PRESS.md"><img src="docs/card-halloween.jpg" alt="360 tv-modellen · 97 merken · 30 talen · launcher van 561 KB. Genoemd in TechCrunch, TechRadar, Tom's Guide, Mashable, Android Authority, XDA, FlatpanelsHD, It's FOSS, Phandroid, GIGAZINE, Xataka, WinFuture, Frandroid, Macitynet, Techaeris, TechPP en nog 298 media: 314 artikelen uit 44 landen. Voorheen: het standaard Google TV-startscherm met een gesponsorde advertentie. Daarna: de Clean Your TV-launcher." width="800"></a>
</p>
**De virale tweet:** [x.com/gathint/status/2111379569030939102](https://x.com/gathint/status/2111379569030939102)
diff --git a/docs/card-halloween.jpg b/docs/card-halloween.jpg
new file mode 100644
index 000000000..e125890d6
Binary files /dev/null and b/docs/card-halloween.jpg differ
diff --git a/docs/new-home-halloween.jpg b/docs/new-home-halloween.jpg
new file mode 100644
index 000000000..95a5cf852
Binary files /dev/null and b/docs/new-home-halloween.jpg differ
diff --git a/tests/test_press_counts.py b/tests/test_press_counts.py
index fdad8782f..4920fcf68 100644
--- a/tests/test_press_counts.py
+++ b/tests/test_press_counts.py
@@ -44,7 +44,7 @@ YOUTUBE_LINK = re.compile(r"\((https?://[^)\s]*youtube\.com/[^)\s]+)\)")
# The card image the numbers are drawn on, wherever a README shows it: README.md in English, README.nl.md
# in Dutch and README.de.md in German, and any translation that copies the picture later. The words
# around the numbers are translated; the numbers are not.
-CARD_ALT = re.compile(r'src="docs/card\.jpg"[^>]*?alt="([^"]*)"')
+CARD_ALT = re.compile(r'src="docs/card(?:-halloween)?\.jpg"[^>]*?alt="([^"]*)"')
def card_alt_texts():
diff --git a/tools/readme_card.py b/tools/readme_card.py
index cb70b5611..28b0fe8d2 100644
--- a/tools/readme_card.py
+++ b/tools/readme_card.py
@@ -3,6 +3,10 @@ the file the front page displays.
Run tools/readme_stats.py and tools/readme_featured.py first, then:
python3 tools/readme_card.py Fredoka.ttf docs/card.jpg
+python3 tools/readme_card.py --halloween Fredoka.ttf docs/card-halloween.jpg # the October variant
+The Halloween variant keeps the layout and the generated numbers: it recolours docs/stats.png's mint
+numbers and the headings to pumpkin orange, adds a dripping stripe, a few bats and pumpkins, and shows
+docs/new-home-halloween.jpg as AFTER. docs/card.jpg is not touched, so the README goes back with one line.
Fredoka is the variable TTF from Google Fonts, and its file is not in this repo: pass the path of the
copy you downloaded. The four pictures it stacks are this checkout's own - docs/stock-home.jpg,
docs/new-home.jpg and the two its siblings draw - so run it from the repository root.
@@ -10,7 +14,7 @@ docs/new-home.jpg and the two its siblings draw - so run it from the repository
import os
import sys
-USAGE = ("usage: readme_card.py <font.ttf> <out.jpg>\n"
+USAGE = ("usage: readme_card.py [--halloween] <font.ttf> <out.jpg>\n"
" Fredoka, the variable TTF from Google Fonts, is not in this repo: download it and pass the\n"
" path of the file you saved.")
@@ -22,6 +26,7 @@ def font_and_out(argv):
the first thing that fails here, and Pillow's `OSError: cannot open resource` names neither the file
it wanted nor where to get it.
"""
+ argv = [a for a in argv if a != "--halloween"]
if len(argv) != 3:
sys.exit(USAGE)
font, out = argv[1], argv[2]
@@ -53,6 +58,7 @@ def out_problem(path):
return None
+HALLOWEEN = "--halloween" in sys.argv
FONT, OUT = font_and_out(sys.argv)
# The picture is the other argument the reader types, and Pillow only refuses it after the whole thing
@@ -75,11 +81,12 @@ INPUTS = (
("docs/stats.png", "tools/readme_stats.py draws it"),
("docs/featured.png", "tools/readme_featured.py draws it"),
)
+HALLOWEEN_INPUTS = (("docs/new-home-halloween.jpg", None),)
def inputs_problem():
"""Why a picture the card stacks cannot be read, or None."""
- for path, drawn_by in INPUTS:
+ for path, drawn_by in INPUTS + (HALLOWEEN_INPUTS if HALLOWEEN else ()):
if os.path.isdir(path):
return (f"{path} is a folder, and the card reads one picture from it: pass this checkout's "
f"file, run from the repository root")
@@ -98,7 +105,7 @@ if INPUTS_PROBLEM:
# See readme_stats.py: Pillow lives in the optional requirements file, so name it rather than crash.
try:
- from PIL import Image, ImageDraw, ImageFilter, ImageFont
+ from PIL import Image, ImageChops, ImageDraw, ImageFilter, ImageFont
except ImportError:
sys.exit("readme_card.py needs Pillow: tools/venv/bin/pip install -r tools/requirements-perf.txt")
@@ -117,6 +124,7 @@ def load(path):
BG, LINE, DIM, GREEN = "#15181e", "#2c313a", "#aab3bd", "#cfffcf"
+ORANGE = "#ff9a3c" # the Halloween variant's mint
W = 1600
def f(size, wt):
# A path that exists is not yet a font: Google Fonts serves Fredoka as a zip holding the variable
@@ -139,9 +147,16 @@ def spaced(d, cx, y, t, font, sp, fill):
# the TV screens, cropped to the bezel; the Wi-Fi name on the after shot is blurred
before = load("docs/stock-home.jpg").crop((130, 216, 1317, 864))
-after = load("docs/new-home.jpg")
-box = (1150, 236, 1240, 280); after.paste(after.crop(box).filter(ImageFilter.GaussianBlur(9)), box)
-after = after.crop((203, 138, 1467, 792))
+if HALLOWEEN:
+ # the 1920x1080 capture of the Halloween Home; its Wi-Fi name is blurred the same way
+ after = load("docs/new-home-halloween.jpg")
+ box = (1390, 128, 1525, 192); after.paste(after.crop(box).filter(ImageFilter.GaussianBlur(9)), box)
+ after = after.crop((60, 30, 1860, 1000))
+ GREEN = ORANGE
+else:
+ after = load("docs/new-home.jpg")
+ box = (1150, 236, 1240, 280); after.paste(after.crop(box).filter(ImageFilter.GaussianBlur(9)), box)
+ after = after.crop((203, 138, 1467, 792))
PAD, ARROW = 70, 90
tw = (W - 2 * PAD - ARROW) // 2
shots = [im.resize((tw, round(im.height * tw / im.width)), Image.LANCZOS) for im in (before, after)]
@@ -156,13 +171,75 @@ ax, ay = W / 2, 90 + th / 2
d.line([(ax - 26, ay), (ax + 26, ay)], fill=GREEN, width=5)
d.line([(ax + 8, ay - 16), (ax + 27, ay), (ax + 8, ay + 16)], fill=GREEN, width=5, joint="curve")
-parts = [load("docs/stats.png"), load("docs/featured.png"), tv]
+def tint(img, box, src="#cfffcf", dst=ORANGE):
+ """Moves the pixels in `box` that sit between the dark background and `src` the same way to `dst`.
+
+ Anti-aliased edges keep their weight: a pixel's share of `src` is read from how far green sits above
+ blue, and that share is moved to `dst`. The grey labels and the logos have blue above green, so they
+ are left as they are."""
+ box = tuple(box); part = img.crop(box)
+ r, g, b = part.split()
+ share = ImageChops.subtract(g, b).point(lambda v: min(255, v * 255 // 48))
+ s_rgb, d_rgb = Image.new("RGB", (1, 1), src).getpixel((0, 0)), Image.new("RGB", (1, 1), dst).getpixel((0, 0))
+ moved = Image.merge("RGB", [c.point(lambda v, k=k: max(0, min(255, v + d_rgb[k] - s_rgb[k])))
+ for k, c in enumerate((r, g, b))])
+ img.paste(Image.composite(moved, part, share), box)
+
+
+def heading(img, box):
+ """The grey 'Featured in' heading in `box`, in orange: its brightness decides how much orange."""
+ box = tuple(box); part = img.crop(box)
+ light = part.convert("L").point(lambda v: max(0, min(255, (v - 24) * 255 // 206)))
+ img.paste(Image.composite(Image.new("RGB", part.size, ORANGE), part, light), box)
+
+
+def decorate(card, ys):
+ """A dripping stripe along the top, and a few bats and pumpkins at low opacity."""
+ import math
+ layer = Image.new("RGBA", card.size, (0, 0, 0, 0)); dl = ImageDraw.Draw(layer)
+ for x0, x1, drop in ((0, 90, 20), (150, 190, 46), (260, 300, 26), (410, 450, 52), (520, 570, 22),
+ (640, 690, 38), (790, 830, 56), (900, 940, 24), (1010, 1060, 44), (1130, 1170, 28),
+ (1250, 1290, 50), (1380, 1420, 24), (1490, 1530, 42), (1560, 1600, 20)):
+ dl.rounded_rectangle([x0, 0, x1, drop], radius=(x1 - x0) // 2, fill=ORANGE)
+ dl.rectangle([0, 0, W, 12], fill=ORANGE)
+ card.paste(Image.composite(Image.new("RGB", card.size, ORANGE), card, layer.split()[3].point(lambda v: v * 9 // 10)))
+ deco = Image.new("RGBA", card.size, (0, 0, 0, 0)); dd = ImageDraw.Draw(deco)
+
+ def bat(cx, cy, s):
+ pts = [(0, -4), (3, -8), (5, -3), (16, -9), (30, -2), (22, 0), (26, 9), (14, 4), (6, 12), (0, 5)]
+ pts = pts + [(-x, y) for x, y in reversed(pts)]
+ dd.polygon([(cx + x * s, cy + y * s) for x, y in pts], fill=(255, 154, 60, 70))
+
+ def pumpkin(cx, cy, r):
+ dd.ellipse([cx - r, cy - r * 0.8, cx + r, cy + r * 0.8], fill=(255, 154, 60, 95))
+ dd.ellipse([cx - r * 0.45, cy - r * 0.8, cx + r * 0.45, cy + r * 0.8], outline=(21, 24, 30, 120), width=2)
+ dd.rectangle([cx - 2, cy - r * 0.8 - 8, cx + 2, cy - r * 0.8 + 1], fill=(120, 200, 90, 110))
+ for ex in (-r * 0.4, r * 0.4):
+ dd.polygon([(cx + ex - 5, cy - 2), (cx + ex + 5, cy - 2), (cx + ex, cy - 11)], fill=(21, 24, 30, 200))
+ dd.arc([cx - r * 0.5, cy - 2, cx + r * 0.5, cy + r * 0.5], 15, 165, fill=(21, 24, 30, 200), width=3)
+
+ for cx, cy, s in ((92, 70, 1.3), (1548, 150, 1.3), (565, 352, 1.1), (1090, 478, 1.0), (140, 585, 1.2),
+ (1480, 650, 1.1), (800, 760, 1.0)):
+ bat(cx, cy, s)
+ for cx, cy in ((PAD + 40, ys[0] - 14), (W - PAD - 40, ys[1] - 14), (W - PAD - 60, ys[0] - 14)):
+ pumpkin(cx, cy, 20)
+ card.alpha_composite(deco) if hasattr(card, "alpha_composite") and card.mode == "RGBA" else card.paste(deco, (0, 0), deco)
+
+
+stats, featured = load("docs/stats.png"), load("docs/featured.png")
+if HALLOWEEN:
+ tint(stats, (0, 0, W, 130)) # the generated numbers, mint to orange
+ heading(featured, (650, 50, 950, 85)) # "FEATURED IN"
+ tint(featured, (1090, 315, 1135, 352)) # the arrow after "314 articles"
+parts = [stats, featured, tv]
SEP = 24 # extra air on each side of a divider
H = sum(p.height for p in parts) + 2 * SEP * (len(parts) - 1)
card = Image.new("RGB", (W, H), BG); d = ImageDraw.Draw(card); y = 0
for i, p in enumerate(parts):
if i: y += SEP; d.line([(PAD, y), (W - PAD, y)], fill=LINE, width=2); y += SEP
card.paste(p, (0, y)); y += p.height
+if HALLOWEEN:
+ decorate(card, (parts[0].height + SEP, parts[0].height + parts[1].height + 3 * SEP))
try:
card.save(OUT, quality=88, optimize=True)
except (OSError, ValueError) as error: