@@ -50,7 +50,8 @@ def get_texture(path, is_block):
5050
5151 return img
5252
53- def create_background (width , height , override_path ):
53+ def create_background (width , height , config ):
54+ override_path = config .get ("background_override" )
5455 if override_path and os .path .exists (override_path ):
5556 bg = Image .open (override_path ).convert ("RGBA" )
5657 # Resize to fill, center crop
@@ -60,11 +61,16 @@ def create_background(width, height, override_path):
6061 left = (bg .width - width ) / 2
6162 top = (bg .height - height ) / 2
6263 bg = bg .crop ((left , top , left + width , top + height ))
63- bg = bg .filter (ImageFilter .GaussianBlur (radius = 5 ))
64+
65+ blur_radius = config .get ("background_blur_radius" , 5 )
66+ if blur_radius > 0 :
67+ bg = bg .filter (ImageFilter .GaussianBlur (radius = blur_radius ))
6468 return bg
6569 else :
6670 # Default gradient (solid color as a fallback if no dynamic gen is wanted)
67- bg = Image .new ("RGBA" , (width , height ), (211 , 140 , 83 , 255 ))
71+ color_arr = config .get ("background_color" , [211 , 140 , 83 , 255 ])
72+ color = tuple (color_arr )
73+ bg = Image .new ("RGBA" , (width , height ), color )
6874 return bg
6975
7076def main ():
@@ -85,7 +91,7 @@ def main():
8591 canvas_width = 1920
8692 canvas_height = 1080
8793
88- bg = create_background (canvas_width , canvas_height , config . get ( "background_override" ) )
94+ bg = create_background (canvas_width , canvas_height , config )
8995
9096 try :
9197 inv_slot = Image .open (INV_SLOT_PATH ).convert ('RGBA' )
0 commit comments