← back to Designer Wallcoverings
TK-135: deeper palette (k16/top8) to capture all pattern colors; fix active-images 2-col pull
28363744642c02cd8b3f6b62d6dcb363f9a23326 · 2026-07-28 07:10:31 -0700 · Steve
Files touched
M shopify/scripts/tk135-image-palette.py
Diff
commit 28363744642c02cd8b3f6b62d6dcb363f9a23326
Author: Steve <steve@designerwallcoverings.com>
Date: Tue Jul 28 07:10:31 2026 -0700
TK-135: deeper palette (k16/top8) to capture all pattern colors; fix active-images 2-col pull
---
shopify/scripts/tk135-image-palette.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/shopify/scripts/tk135-image-palette.py b/shopify/scripts/tk135-image-palette.py
index e980dcd8..f878ce30 100644
--- a/shopify/scripts/tk135-image-palette.py
+++ b/shopify/scripts/tk135-image-palette.py
@@ -64,10 +64,10 @@ def name(rgb):
if H < 290: return 'Purple'
return 'Pink'
-def palette(url, k=8, top=4):
+def palette(url, k=16, top=8): # deeper: capture ALL significant pattern colors, not just top-4
req = urllib.request.Request(thumb(url), headers={'User-Agent': 'Mozilla/5.0'})
im = Image.open(io.BytesIO(urllib.request.urlopen(req, timeout=25).read())).convert('RGB')
- im.thumbnail((100, 100))
+ im.thumbnail((120, 120))
q = im.quantize(colors=k, method=Image.MEDIANCUT).convert('RGB')
px = list(q.get_flattened_data()); n = len(px)
raw = [(rgb, 100 * c / n) for rgb, c in collections.Counter(px).most_common(k)]
← f722f343 auto-save: 2026-07-28T06:58:06 (3 files) — shopify/scripts/d
·
back to Designer Wallcoverings
·
TK-135: add Shape: to label normalizer strip set fc665d1c →