Files
Siro/scratch/draw_car.py
2026-06-15 01:37:41 +03:00

49 lines
1.8 KiB
Python

import math
from PIL import Image, ImageDraw
def draw_car_large(draw, color):
# Center: (765, 205)
# Scaled up by 1.25x for better visual weight
# 1. Cabin (upper part)
# Trapezoid: top base from X=740 to 790, bottom base from X=721 to 809, Y=155 to 198
draw.polygon([(740, 155), (790, 155), (809, 198), (721, 198)], fill=color)
# Windshield (white trapezoid inside cabin)
draw.polygon([(743, 161), (787, 161), (802, 194), (728, 194)], fill=(255, 255, 255, 255))
# Vertical divider in windshield
draw.rectangle([763, 161, 767, 194], fill=color)
# 2. Main body (lower part)
# Polygon with cut corners: X=703 to 827, Y=195 to 255
draw.polygon([
(712, 195), (818, 195),
(827, 204), (827, 246),
(818, 255), (712, 255),
(703, 246), (703, 204)
], fill=color)
# 3. Headlights (white circles)
r_head = 9
draw.ellipse([722 - r_head, 222 - r_head, 722 + r_head, 222 + r_head], fill=(255, 255, 255, 255))
draw.ellipse([808 - r_head, 222 - r_head, 808 + r_head, 222 + r_head], fill=(255, 255, 255, 255))
# 4. Grille / Bumper
# Center grill: white rectangle from X=740 to 790, Y=222 to 232
draw.rectangle([740, 222, 790, 232], fill=(255, 255, 255, 255))
# 5. Side mirrors
# Left mirror: polygon at X=694 to 703, Y=190 to 202
draw.polygon([(694, 190), (703, 195), (703, 203), (694, 198)], fill=color)
# Right mirror: polygon at X=827 to 836, Y=190 to 202
draw.polygon([(836, 190), (827, 195), (827, 203), (836, 198)], fill=color)
im = Image.open('scratch/logo_s_only.png')
draw = ImageDraw.Draw(im)
color = (29, 32, 47, 255)
draw_car_large(draw, color)
im.save('scratch/service_logo_test_car_large.png')
print("Saved large service logo to scratch/service_logo_test_car_large.png")