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 5 in gelb mit transparenten Hintergrund

SIE SPAREN 1.895,- €

Renault 5 in gelb mit transparenten Hintergrund

SIE SPAREN 4.455,- €

Renault 5 in gelb mit transparenten Hintergrund

SIE SPAREN 7.505,- €

Renault 5 in gelb mit transparenten Hintergrund

SIE SPAREN 500,- €

Renault 5 in gelb mit transparenten Hintergrund

SIE SPAREN 2.695,- €

Renault 5 in gelb mit transparenten Hintergrund

SIE SPAREN 7.505,- €

Renault 5 in gelb mit transparenten Hintergrund

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

CHRISTIAN HABERLAND-KRAUS

CHRISTIAN HABERLAND-KRAUS

Automobilverkäufer

Telefon: +499131-7543-31

E-Mail: chk@auto-kraus.de

ROBERT RÖDEL

ROBERT RÖDEL

Verkaufsleitung

BOJAN BAJIC

BOJAN BAJIC

Automobilverkäufer

SÖREN BRANDMÄHL-KRAUS

SÖREN BRANDMÄHL-KRAUS

Verkauf Gewerbe/Kommunen Fuhrparkmanager Nutzfahrzeuge