# ----------------------------- # Resolve Base Directory (Sandbox Safe) # ----------------------------- try: BASE_DIR = os.path.dirname(os.path.abspath(__file__)) except NameError: BASE_DIR = os.getcwd() ASSETS_DIR = os.path.join(BASE_DIR, "assets") OUTPUT_DIR = os.path.join(BASE_DIR, "output") # ----------------------------- # Configuration # ----------------------------- MOCKUP_PATH = os.path.join(ASSETS_DIR, "shirt_mockup.png") DESIGN_PATH = os.path.join(ASSETS_DIR, "design.png") OUTPUT_PATH = os.path.join(OUTPUT_DIR, "shirt_mockup_result.png") # Position and size of the design on the shirt DESIGN_WIDTH_RATIO = 0.45 DESIGN_X_RATIO = 0.275 DESIGN_Y_RATIO = 0.32 DESIGN_OPACITY = 0.95 # ----------------------------- # Asset Creation Helpers # ----------------------------- def ensure_directories(): os.makedirs(ASSETS_DIR, exist_ok=True) os.makedirs(OUTPUT_DIR, exist_ok=True) def create_placeholder_mockup(path): img = Image.new("RGBA", (1200, 1600), (245, 245, 245, 255)) draw = ImageDraw.Draw(img) draw.rectangle([300, 400, 900, 1300], outline=(180, 180, 180), width=6) draw.text((460, 820), "SHIRT MOCKUP", fill=(150, 150, 150)) img.save(path) def create_placeholder_design(path): img = Image.new("RGBA", (800, 600), (0, 0, 0, 0)) draw = ImageDraw.Draw(img) draw.rectangle([100, 100, 700, 500], outline=(0, 0, 0), width=6) draw.text((260, 260), "DESIGN", fill=(0, 0, 0)) img.save(path) # ----------------------------- # Ensure Assets Exist (Sandbox Safe) # ----------------------------- ensure_directories() if not os.path.isfile(MOCKUP_PATH): create_placeholder_mockup(MOCKUP_PATH) if not os.path.isfile(DESIGN_PATH): create_placeholder_design(DESIGN_PATH) # ----------------------------- # Load Images # ----------------------------- mockup = Image.open(MOCKUP_PATH).convert("RGBA") design = Image.open(DESIGN_PATH).convert("RGBA") # ----------------------------- # Resize Design # ----------------------------- shirt_width, shirt_height = mockup.size new_width = int(shirt_width * DESIGN_WIDTH_RATIO) new_height = int(new_width * design.height / design.width) design = design.resize((new_width, new_height), Image.LANCZOS) # ----------------------------- # Adjust Design Opacity # ----------------------------- alpha = design.split()[3] alpha = ImageEnhance.Brightness(alpha).enhance(DESIGN_OPACITY) design.putalpha(alpha) # ----------------------------- # Position Design # ----------------------------- x_pos = int(shirt_width * DESIGN_X_RATIO) y_pos = int(shirt_height * DESIGN_Y_RATIO) # ----------------------------- # Composite Images # ----------------------------- final_image = mockup.copy() final_image.paste(design, (x_pos, y_pos), design) # ----------------------------- # Save Output # ----------------------------- final_image.save(OUTPUT_PATH, "PNG") print("Mockup generated successfully") print(f"Base directory: {BASE_DIR}") print(f"Output file: {OUTPUT_PATH}") # ----------------------------- # Runtime Tests (Do Not Remove) # ----------------------------- def _self_test(): # Directory checks assert os.path.isdir(ASSETS_DIR), "Assets directory missing" assert os.path.isdir(OUTPUT_DIR), "Output directory missing" # File checks assert os.path.isfile(MOCKUP_PATH), "Mockup image missing" assert os.path.isfile(DESIGN_PATH), "Design image missing" assert os.path.isfile(OUTPUT_PATH), "Output image missing" # Image sanity with Image.open(OUTPUT_PATH) as img: assert img.width > 0 and img.height > 0, "Invalid output image" # Placeholder integrity with Image.open(MOCKUP_PATH) as m: assert m.mode == "RGBA", "Mockup image mode invalid" _self_test() """
top of page

Gallery

Welcome to my gallery, where creativity knows no bounds Each design showcases a unique blend of colors, shapes, and textures, reflecting my artistic vision and passion. From unique styles to dynamic motifs, there's something for everyone. Explore the collection and find the perfect piece to inspire your space!

export202207080156219560

export202207080156219560

export202204011619347180

export202204011619347180

export202211051903040056

export202211051903040056

export202207020932399330

export202207020932399330

export202204011609386040

export202204011609386040

export202204011638079670

export202204011638079670

export202210171831047104

export202210171831047104

export202204190852461370

export202204190852461370

export202209160315481350

export202209160315481350

export202204011447046110

export202204011447046110

export202204011433123280

export202204011433123280

export202207031800535540

export202207031800535540

export202207031645426790

export202207031645426790

Screenshot_20240120_141329_Gallery

Screenshot_20240120_141329_Gallery

export202212191646420955

export202212191646420955

Hyperbolic time chamber (5)

Hyperbolic time chamber (5)

Hyperbolic time chamber (6)

Hyperbolic time chamber (6)

export202210030131233726

export202210030131233726

export202210030131075887

export202210030131075887

export202207072005373760

export202207072005373760

bottom of page