Created split_png_by_brightness.py to split rasterized logos into separate SVG files by color for Underground Magnetics logo conversion. Key features: - OpenCV contour hierarchy detection for proper hole handling - Letters with enclosed shapes (d, o, g, etc.) now render correctly - Tight brightness thresholds to avoid antialiasing artifacts - Automatic bounding box cropping for optimal file sizes - Black text: brightness < 40 (236k pixels, 21 shape groups) - Grey icon: brightness 108-118 (119k pixels, 2 shape groups) Results: - um_black.svg: 6.1KB, 3070x233px (was 139KB, 3613x391px) - um_grey.svg: 728B, 413x390px (was 253KB, 3613x391px) Files: - split_png_by_brightness.py: Main color separation tool - IMPROVEMENTS.md: Detailed changelog and comparison - README_underground_magnetics.md: Usage documentation - underground-magnetics.eps: Source logo file - um_black.svg: Separated black text (cropped) - um_grey.svg: Separated grey icon (cropped) - requirements.txt: Added opencv-python dependency 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
5 lines
728 B
XML
5 lines
728 B
XML
<?xml version='1.0' encoding='utf-8'?>
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="413" height="390" viewBox="0 0 413 390">
|
|
<path d="M 159,0 L 159,116 L 164,135 L 175,150 L 187,157 L 198,160 L 214,160 L 223,158 L 236,151 L 243,144 L 250,131 L 252,124 L 253,0 Z" fill="#808080" fill-rule="evenodd" />
|
|
<path d="M 0,0 L 0,389 L 99,389 L 100,292 L 107,302 L 122,317 L 135,326 L 161,337 L 178,341 L 198,343 L 234,341 L 263,333 L 279,325 L 294,314 L 306,301 L 312,292 L 313,389 L 412,389 L 412,0 L 314,0 L 314,119 L 311,140 L 305,159 L 299,171 L 290,184 L 272,201 L 261,208 L 241,217 L 212,223 L 200,223 L 182,220 L 153,209 L 134,196 L 120,181 L 111,167 L 102,143 L 98,114 L 98,0 Z" fill="#808080" fill-rule="evenodd" />
|
|
</svg> |