from PIL import Image
import numpy as np, os, math, shutil, subprocess
from skimage.morphology import skeletonize
photo_path="/mnt/data/dacia-striker-3(1).jpg"
line_path="/mnt/data/a_clean_minimal_architectural_line_art_illustrati.png"
photo=Image.open(photo_path).convert("RGB")
line=Image.open(line_path).convert("L")
# crop photo to 9:16 portrait, preserving car and wall
pw,ph=photo.size
target_ratio=9/16
crop_h=int(pw/target_ratio)
# image isn't tall enough, so extend canvas vertically with white bands
W,H=1080,1920
scale=W/pw
res=photo.resize((W,int(ph*scale)),Image.Resampling.LANCZOS)
canvas=Image.new("RGB",(W,H),"white")
y0=(H-res.height)//2
canvas.paste(res,(0,y0))
# Wall coordinates in final portrait frame, based on original photo geometry.
# Original photo: wall x ~300..1480, y ~90..680. Map via scale.
sx= W/pw
wall_left=int(260*sx)
wall_right=int(1480*sx)
wall_top=int((75*sx)+y0)
wall_bottom=int((720*sx)+y0)
# Prepare line art mask
arr=np.array(line)
skel=skeletonize(arr<170)
ys,xs=np.where(skel)
minx,maxx,miny,maxy=xs.min(),xs.max(),ys.min(),ys.max()
# target castle footprint on wall; leave some room around it
tx0,tx1=wall_left+25,wall_right-20
ty0,ty1=wall_top+10,wall_bottom-30
scale_x=(tx1-tx0)/(maxx-minx)
scale_y=(ty1-ty0)/(maxy-miny)
s=min(scale_x,scale_y)
new_w=int((maxx-minx)*s)
new_h=int((maxy-miny)*s)
ox=tx0+(tx1-tx0-new_w)//2
oy=ty0+(ty1-ty0-new_h)//2
# get skeleton pixel coordinates in final image
py,px=np.where(skel)
fx=ox+(px-minx)*s
fy=oy+(py-miny)*s
pts=np.stack([fx,fy],axis=1)
# Build a reveal order approximating "laser drawing": scan top-to-bottom, then left-to-right
# Group pixels into many small strokes via nearest-neighbor ordering within horizontal bands.
# Use a simple cumulative order based on y bands and x, which visually reads like drawing.
order=np.lexsort((fx,fy))
pts=pts[order]
# Downsample point sequence
step=max(1,int(len(pts)/12000))
pts=pts[::step]
# Build line drawing from cumulative points, but to look hand-drawn use short connected trails
# We reveal pixels in scan order and connect close neighbors only.
# Instead, use an image mask where each point is revealed according to its scan rank.
mask_img=np.zeros((H,W),dtype=np.uint8)
for i,(x,y) in enumerate(pts):
xi,yi=int(round(x)),int(round(y))
if 0<=xi0
# Protect the car and person with manually defined polygons (in final canvas coordinates).
# These polygons cover their visible silhouettes so the drawing remains behind them.
protect=Image.new("L",(W,H),0)
pd=ImageDraw.Draw(protect)
# car approximate silhouette
car_poly=[(205,930),(230,880),(330,845),(430,835),(520,830),(615,845),(700,880),(760,900),
(780,955),(770,1010),(730,1040),(690,1045),(650,1010),(620,960),(390,960),(355,1010),
(300,1035),(240,1015),(210,975)]
pd.polygon(car_poly,fill=255)
# wheels
pd.ellipse((235,920,345,1045),fill=255)
pd.ellipse((635,920,755,1055),fill=255)
# woman approximate silhouette
person=[(825,610),(870,600),(900,630),(910,700),(900,770),(920,850),(950,930),(935,1010),
(900,1060),(860,1050),(875,980),(840,930),(810,850),(800,770),(805,690)]
pd.polygon(person,fill=255)
protect_arr=np.array(protect)>0
mask_arr[protect_arr]=False
# Use the original photo's wall mask to keep drawing only within upper wall region.
wallmask=np.zeros((H,W),dtype=bool)
wallmask[wall_top:wall_bottom,wall_left:wall_right]=True
mask_arr &= wallmask
# Create per-frame reveal using pixel rank
ys2,xs2=np.where(mask_arr)
# Recompute order by a path-like sequence: y bands, x
ord2=np.lexsort((xs2,ys2))
ys2,xs2=ys2[ord2],xs2[ord2]
n=len(xs2)
rank=np.zeros((H,W),dtype=np.int32)
rank[ys2,xs2]=np.arange(n)
fps=30
seconds=7
frames=int(fps*seconds)
frames_dir="/mnt/data/castle_wall_frames"
os.makedirs(frames_dir,exist_ok=True)
for i in range(frames):
t=i/(frames-1)
progress=min(1,(t/0.90)**0.75)
threshold=int(progress*n)
show=rank<=threshold
# 1-pixel-ish dark line plus subtle red laser leading point
overlay=canvas.copy()
oa=np.array(overlay)
# black line with slight transparency
oa[show]=[35,35,35]
frame=Image.fromarray(oa)
d=ImageDraw.Draw(frame)
if threshold
XXL -Inventurabverkauf
RENAULT CLIO
Evolution TCe 90
Jetzt nur21.650 €
UVP 23.545
EZ: 29.04.2025 • 1.000 km • Black-Pearl-Schwarz
Klimaanlage
Tempopilot mit Geschwindigkeitsbegrenzer
Einparkhilfe hinten
EasyLink 7-Zoll inkl. kabelloser Smartphone-Replikation
Müdigkeitswarner, Notbremsassistent mit Fußgängererkennung
Renault Clio TCe 90: Gesamtverbrauch kombiniert (l/100 km): 5,3; CO2-Emission kombiniert (g/km): 120; CO2-Klasse: D.
SIE SPAREN 1.895,- €
RENAULT CAPTUR
TCe 90
Jetzt nur21.990 €
UVP 26.445
EZ: 13.12.2022 • 5.000 km • Stahl-Grau
Klimaautomatik
Sitzheizung vorne, Rückfahrkamera, 2-Farb-Lackierung,
Notbremsassistent, Abstandswarner, Spurwechselwarner,
Winterpaket,Tempomat, LED-Scheinwerfer ,
Verkehrszeichenerkennung, Start/Stopp-Automatik
u.v.m.
Renault Clio TCe 90: Gesamtverbrauch kombiniert (l/100 km
): 5,3; CO2-Emission kombiniert (g/km): 120; CO2-Klasse: D.
SIE SPAREN 4.455,- €
RENAULT AUSTRAL
Techno Mild Hybrid
Jetzt nur32.990 €
UVP 40.495
EZ: 26.03.2024 • 1.500 km • Black-Pearl-Schwarz
Klimaautomatik
Premium City-Paket, Winter-Paket, Dachreling
12-Zoll openR link mit Navigation und Google Services
19-Zoll-Leichmetallfegen, Voll-LED-Scheinwerfer LED Pure Vision
Ambientebeleuchtung, Easy-Park-Assistent , beheizbares
Lenkrad, u.v.m Renault Clio TCe 90: Gesamtverbrauch kombiniert (l/100 km
): 5,3; CO2-Emission kombiniert (g/km): 120; CO2-Klasse: D.
SIE SPAREN 7.505,- €
eSchwalbe
50er Refurbed
Jetzt nur3.490 €
UVP 3.990
EZ: 29.04.2025 • 1.000 km • Black-Pearl-Schwarz
Klimaanlage
Tempopilot mit Geschwindigkeitsbegrenzer
Einparkhilfe hinten
EasyLink 7-Zoll inkl. kabelloser Smartphone-Replikation
Müdigkeitswarner, Notbremsassistent mit Fußgängererkennung
Renault Clio TCe 90: Gesamtverbrauch kombiniert (l/100 km): 5,3; CO2-Emission kombiniert (g/km): 120; CO2-Klasse: D.
SIE SPAREN 500,- €
MITSUBISHI SpaceStar
Basis 90
Jetzt nur11.990 €
UVP 14.685
Berganfahrhilfe (HSA)
Kühlergrill in Chrom-Optik
Servolenkung
14″ Stahlfelgen mit Radzierkappen
u.v.m. Cl
io TCe 90: Ge
samtverbrauch kombiniert (l/100 km
): 5,3; CO2-Emamtverbrauch kombiniert (l/100 km
): 5,3; CO2-Emission kombiniert (g/km): 120; CO2-Klasse: D.
SIE SPAREN 2.695,- €
Mitsubishi Eclipse Cross
Plug-in Hybrid Plus
Jetzt nur33.990 €
UVP 47.395
EZ: 30.05.2025 • 1. 500 km • Laser-Blau
Klimaautomatik
Standheizung
Mitsubishi Remote System
18-Zoll-Leichmetallfegen, Super All Wheel Control
Schnellladeanschluss
u.v.m
Renault Clio TCe 90: Gesamtverbrauch kombiniert (l/100 km
): 5,3; CO2-Emission kombiniert (g/km): 120; CO2-Klasse: D.
SIE SPAREN 7.505,- €
Renault Kangoo Rapid
E-Tech Start L1
Jetzt nur25.720 €
UVP 48.945
EZ: 16.012.2022 • 500 km • Mineral-Weiß
Klimaautomatik mit Wärmepumpe
Tempopilot mit Geschwindigkeitsbegrenzer
City-Paket Light, Trennwand geschlossen,
Schiebetüre rechts, Navigationssystem,
Laderaumschutzpaket, Ganzjahresreifen
Renault Clio TCe 90: Gesamtverbrauch kombiniert (l/100 km): 5,3; CO2-Emission kombiniert (g/km): 120; CO2-Klasse: D.
SIE SPAREN 23.225,- €
Bei uns gibt es noch viele
weitere Neuwagen,
Tageszulassungen und
Vorführwagen zu
attraktiven
Mitnahmepreisen.
Schauen Sie vorbei!
1
Gerne können Sie auch
Ihr Wunschfahrzeug in
unserer Autobörse
suchen!
VERKAUF




SÖREN BRANDMÄHL-KRAUS
Verkauf Gewerbe/Kommunen Fuhrparkmanager Nutzfahrzeuge
Telefon: +499131-7543-34
E-Mail: sbk@auto-kraus.de






