Matches Tabler Icons (SVG) against a Telegram
Desktop / tdesktop-fork icon set (PNG) using SigLIP (ViT-B-16-SigLIP-256)
visual + semantic similarity, then rearranges and copies the untouched Tabler
SVGs into the exact folder structure and filenames of the original Telegram
icon set.
tabler/ ← put the Tabler icons SVG source here (any subfolder depth)
tdesktop/ ← put your fork's existing reference icon PNGs here
(mirror whatever folder structure tdesktop/Telegram/Resources/icons uses)
icon_matcher.py ← the matching and rearranging tool
svg2png_qt.py ← standalone batch SVG→PNG @1x/2x/3x converter (optional, separate use)
requirements.txt
.github/workflows/build-icons.yml ← CI version of the pipeline below
tabler/ and tdesktop/ are empty except for a .gitkeep — drop your
icon sets in before running anything.
- Push this repo to GitHub with your icons added under
tabler/andtdesktop/. - Go to the Actions tab → Build Icon Pack → Run workflow (or just push a change under either folder — it triggers automatically).
- When it finishes, download the
new_icon_packartifact from the run summary page. It contains the reorganized SVGs (and PNGs, if--emit-pngstays on) plusmatches_report.csv.
Uses macos-latest (Apple Silicon M-series runners), PyTorch with
MPS acceleration, and Homebrew (brew install resvg librsvg) for
high-performance rendering and embedding.
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install -r requirements.txt
# + a renderer: apt install librsvg2-bin (or install resvg for higher fidelity)
python icon_matcher.py index --src tdesktop --kind png --out telegram_index.pkl
python icon_matcher.py index --src tabler --kind svg --out tabler_index.pkl
python icon_matcher.py match \
--ref-index telegram_index.pkl \
--cand-index tabler_index.pkl \
--out-dir new_icon_pack \
--report matches_report.csv \
--threshold 0.75 \
--emit-pngRuns fine on a CPU-only laptop (no dedicated GPU required) — expect roughly 15–30 minutes total for a few thousand icons, one-time.
- Always review
matches_report.csvbefore treating the output as final. Matching is similarity-based, not guaranteed correct — rows markedREVIEWscored below the threshold and need a manual look, but spot-check some "confident" matches too. - The SVGs in
new_icon_pack/are copied verbatim from Tabler source with no XML/transform modifications, preserving full SVG fidelity.