diff --git a/DEV_LOG.md b/DEV_LOG.md index a17fa1199..207911454 100644 --- a/DEV_LOG.md +++ b/DEV_LOG.md @@ -33,3 +33,11 @@ Posodobili smo dokument `docs/GAME_DESIGN_NOTES.md` z naslednjimi koncepti: --- **Status:** Pripravljeno na implementacijo v Unity/Game Engine. + +### 4. Zaključna Sinhronizacija (25.01.2026 12:36 CET) +* **MASTER BIBLE in GAME BIBLE usklajena:** + * Potrjenih **20 biomov** (vključno z Witch Forest in Mexican Cenotes). + * 11 Magičnih (Anomalous) biomov. + * 10-Fazna struktura izdajanja. +* **Licence Preverjene:** Najdene so v (Apache, MIT, BSD), kar je pričakovano za Python knjižnice. +* **Koda in Dokumentacija:** Vse posodobljeno in pripravljeno na vnos referenc. diff --git a/assets/references/.DS_Store b/assets/references/.DS_Store new file mode 100644 index 000000000..5008ddfcf Binary files /dev/null and b/assets/references/.DS_Store differ diff --git a/assets/references/GAME_DESIGN_NOTES.md b/assets/references/GAME_DESIGN_NOTES.md new file mode 100644 index 000000000..d762f3ffb --- /dev/null +++ b/assets/references/GAME_DESIGN_NOTES.md @@ -0,0 +1,65 @@ +# Game Design Ideas & Mechanics + +## 1. Demo & Monetization Structure +* **Trial Version Badge:** The game displays a "Trial Version" badge. It records the date when the user first downloaded/started the demo. +* **"Purchase Full Game" Trigger:** A UI prompt (badge) appears, encouraging the player to buy the full version. +* **Limited Progression (The "Hook"):** + * **Housing:** In the demo, you can only upgrade from a **Sleeping Bag** to a **Tent**. You *cannot* build the wooden cabin or better houses. This makes the difference between Demo and Full Game very obvious and painful (motivation to buy). + * **Hoarding:** Players CAN hoard materials and loot as much as they want. This is key: "I have so much stuff, I don't want to lose it!" +* **Endless Sandbox Demo:** The demo has **NO time limit**. The player can play forever. +* **The Trap (Hoarding):** Since there is no end, the player can build infinite storage chests and hoard massive amounts of resources. They invest hundreds of hours gathering materials. +* **Restrictions:** + * **No Story:** The plot does not advance. + * **Zombie Limit:** Only ONE basic zombie type appears. It does not level up, evolve, or get harder. It becomes boring/easy eventually. + * **Housing Cap:** Stuck at "Tent" level forever. +* **The Payoff:** When they finally buy the game, they unlock the Story, evolving Zombies, advanced Building, and keep ALL their thousands of gathered resources to instantly jump-start the real game. +* **Day Count Legacy:** If a player grinded for 200 days in the demo, they start the full game on **Day 200**. They keep their "time served," but the game logic treats it as the moment they finally "start living" and expanding beyond the basic survival grind. +* **Achievements (Steam):** + * **"Stubborn Survivor" (Trmasti preživeli):** Awarded if the player reaches Day 200 *within the demo version*. + * **Unique Reward:** A special **Statue** placable in the full game to commemorate their persistence. + +## 2. Advanced Zombie Mechanics +* **Camouflage/Disguise:** Zombies can disguise themselves as farmers/NPCs. + * *Visuals:* A zombie wearing farmer clothes. + * *Mechanic:* They appear friendly until the player gets within a certain radius, then they reveal their true nature and attack. This adds tension and paranoia. + +## 3. Environmental Hazards: Toxic Fog +* **Nature:** A purple/toxic cloud or explosion event. +* **Mechanic:** + * The fog spreads over time (e.g., expanding daily). + * **Choking Damage:** Entering the fog causes the player to choke (take damage). + * **Counter-play:** The player needs to build/acquire "Fog Sensors" or filtration systems to navigate or clear it. + * **Environmental Expansion:** The fog might block off new biomes or areas. Clearing it or surviving it allows map expansion. + * **Zombie Synergy:** Zombies might be able to spread this fog or be buffed by it. + +## 4. UI Enhancements +* **Day Cycle Notification:** A prominent "Day X" text appears in the center of the screen at the start of each new in-game day. +* **Tracking:** Shows the total number of days survived. + +## 5. World Building & Navigation +* **Signage:** + * Directional signs pointing to major locations: "Town", "Forest", "Mines", "Biomes". + * Warning signs ("Danger", Skull) for hazardous areas. +* **Infrastructure:** + * Cables/Wires: Used for connecting machinery or sensors (fog sensors?). +* **Obstacles:** + * Thorns/Brambles: Block paths, requiring specific tools (upgraded machete/scythe) to clear. +* **Mines:** + * "Death Valley" (Dolina smrti) mine entrance. + * Progression: Needs better equipment to enter deeper levels. + +## 6. Waste Management & Recycling +* **Dumpster/Container:** + * **Placement:** Must be placed away from the main farm (smell/hygiene). + * **Scavenging:** Raccoons raid it for food. Friendly zombies can search it for "smart items" (blueprints, rare parts). +* **Composting:** + * **Structure:** Wooden Compost Bin. + * **Input:** Spoiled food, dead plants, organic waste. + * **Output:** Fertilizer (Manure) to boost crop growth. + +## 7. Zombie Housing (Resting Spots) +* **Structure:** Simple open grave (hole in the ground) with a memorial plaque or wooden cross. +* **Mechanic:** Serves as a "spawn point" or resting bed. When a friendly zombie is tired, it retreats into this hole to sleep and recover energy. +* **Construction:** Easy to build – just dig a hole and place a marker. + + diff --git a/assets/references/PROMPTS_LIST.md b/assets/references/PROMPTS_LIST.md new file mode 100644 index 000000000..e0af7b0f0 --- /dev/null +++ b/assets/references/PROMPTS_LIST.md @@ -0,0 +1,64 @@ +# Seznam Promptov za Generiranje Slik + +Ta datoteka vsebuje natančne "prompte" (opise), ki se uporabljajo za generiranje grafičnih elementov v stilu "Dark Chibi Noir / Farm Survival". + +## 1. Paket: UI in Okolje (Dolina Smrti) + +### UI - Nakup Igre (Badge) +> **Prompt:** `A detailed golden vector game UI badge, ornate shield shape. A skull wearing a royal crown sits on top. Bold majestic text inside reads "PURCHASE FULL GAME". Dark outlines, cel shaded, shiny gold texture, premium rpg style, white background.` + +### VFX - Strupena Megla (Explozija) +> **Prompt:** `A cartoon explosion cloud of toxic gas, purple and pink colors, billowing smoke shapes. Thick black comic book outlines, vector style, flat colors, 2d game asset, isolated on white.` + +### UI - Merilnik Zdravja (Critical) +> **Prompt:** `A steampunk rusty metal circular gauge, labeled "HEALTH GAUGE". The glass cover is cracked and shattered. The red needle is pointing to "CRITICAL". Dirty textures, oil stains, thick dark outlines, 2d game ui asset.` + +### Okolje - Vhod v Rudnik (Dolina Smrti) +> **Prompt:** `A dark spooky mine entrance built into a rock face. Supported by old rotting wooden beams. A wooden sign above the entrance says "DOLINA SMRTI" in rough hand-carved letters. Dark moody atmosphere, thick lines, vector style.` + +### Okolje - Trnje (Ovira) +> **Prompt:** `A dense bush of twisted, sharp black thorns and brambles. Spiky, dangerous looking, dark purple and black tones. 2d game obstacle asset, white background, thick outlines.` + +--- + +## 2. Paket: Znaki in Predmeti + +### Znak - Nevarnost (Danger) +> **Prompt:** `A rusty square metal sign nailed to a wooden post. On the sign is a black skull and crossbones symbol and the word "DANGER" in bold black letters. Barbed wire wrapped around the post. Weathered, gritty cartoon style.` + +### Predmet - Kolut Žice +> **Prompt:** `A spool of silver industrial wire. Brown plastic reel. A sticker on the side reads "HIGH VOLTAGE". clean vector art, isometric view, game inventory item.` + +### Znak - Smerokaz (Mesto/Gozd) +> **Prompt:** `A wooden crossroads signpost. One arrow points left saying "TOWN", one arrow points right saying "FOREST". Moss growing at the base. Cartoon style, thick dark outlines, pleasant wood texture.` + +### Znak - Viseča Tabla (Prazna) +> **Prompt:** `A rectangular wooden board hanging by two metal chains. Empty space in the middle for text. A small cute skull icon pinned to the top left corner. Vector game asset, clean lines.` + +### UI - Trial Version (Badge) +> **Prompt:** `A dark wooden plank sign with a red ribbon banner at the bottom. A skull with bat wings sits on top. Glowing white text in the center reads "TRIAL VERSION". Gothic rpg ui style, vector, isolated.` + +--- + +## 3. Paket: Kmetija, Gradnja in Nagrade + +### Objekt - Gnoj/Kompost (Kup) +> **Prompt:** `A pile of manure and compost. Steaming, flies buzzing around. Mix of brown soil, green plant waste, and animal droppings. Dark Chibi Noir style, gritty farm survival game asset. Thick outlines, flat vector art, white background.` + +### Objekt - Kontejner za Smeti +> **Prompt:** `A rusty metal trash dumpster. Green or blue industrial container, slightly overflowing with trash bags and debris. Weathered texture, scratches, isometric view. Dark Chibi Noir style, survival game asset. Thick outlines, white background.` + +### Objekt - Strašilo (Creepy) +> **Prompt:** `A creepy scarecrow on a wooden cross. Wearing tattered farmer clothes and a burlap sack hood with stitched eyes. Spooky but cute chibi style. Dark survival atmosphere. Thick black outlines, vector art, isolated on white.` + +### Gradnja - Temelj/Zombiji +> **Prompt:** `Construction site foundation. A dug rectangular hole in the ground with a fresh grey concrete slab poured at the bottom. Wooden stakes and string marking the edges. Construction or blueprint phase for a building. Dark Chibi Noir style, isometric view, survival game asset. Thick outlines, white background.` + +### Objekt - Kompostnik (Lesen) +> **Prompt:** `A wooden compost bin structure. Slatted wood sides, filled with soil and organic waste. Farm functionality. Dark Chibi Noir style, detailed wood texture, gritty but cute. Isometric view, thick outlines, white background.` + +### Objekt - Grob (Zombi Postelja) +> **Prompt:** `An open grave hole dug in the ground, looking like a resting spot or bed. Brown dirt pile on the side. A simple wooden headstone or memorial plaque at the head. Empty inside, ready for a zombie to sleep. Dark Chibi Noir style, isometric view, thick outlines, white background.` + +### Nagrada - Kip (200 Dni) +> **Prompt:** `A stone statue reward for a game. A chibi survivor character made of grey stone, leaning tiredly on a shovel but looking proud. Standing on a pedestal with the text '200 DAYS' engraved in gold. Moss growing slightly on the stone. Dark Chibi Noir style, isometric view, thick outlines, white background.` diff --git a/assets/references/Switch:Lever.png b/assets/references/Switch:Lever.png new file mode 100644 index 000000000..f2b4f519c Binary files /dev/null and b/assets/references/Switch:Lever.png differ diff --git a/assets/references/Zabojnik za zombije + Kamenita potka + Zlati hrošč.png b/assets/references/Zabojnik za zombije + Kamenita potka + Zlati hrošč.png new file mode 100644 index 000000000..347748aba Binary files /dev/null and b/assets/references/Zabojnik za zombije + Kamenita potka + Zlati hrošč.png differ diff --git a/assets/references/agregat_1_pokvarjen.png b/assets/references/agregat_1_pokvarjen.png new file mode 100644 index 000000000..dbb6243e6 Binary files /dev/null and b/assets/references/agregat_1_pokvarjen.png differ diff --git a/assets/references/agregat_2_delujoc.png b/assets/references/agregat_2_delujoc.png new file mode 100644 index 000000000..c58304edc Binary files /dev/null and b/assets/references/agregat_2_delujoc.png differ diff --git a/assets/references/ana.png b/assets/references/ana.png new file mode 100644 index 000000000..8d3651e9e Binary files /dev/null and b/assets/references/ana.png differ diff --git a/assets/references/ata.png b/assets/references/ata.png new file mode 100644 index 000000000..e4adab41b Binary files /dev/null and b/assets/references/ata.png differ diff --git a/assets/references/baker_ikona.png b/assets/references/baker_ikona.png new file mode 100644 index 000000000..c3f7a4706 Binary files /dev/null and b/assets/references/baker_ikona.png differ diff --git a/assets/references/bencin_kanta.png b/assets/references/bencin_kanta.png new file mode 100644 index 000000000..f6d007380 Binary files /dev/null and b/assets/references/bencin_kanta.png differ diff --git a/assets/references/bio_gorivo_proizvodnja.png b/assets/references/bio_gorivo_proizvodnja.png new file mode 100644 index 000000000..fd297baa0 Binary files /dev/null and b/assets/references/bio_gorivo_proizvodnja.png differ diff --git a/assets/references/cebelnjak_orodje_set.png b/assets/references/cebelnjak_orodje_set.png new file mode 100644 index 000000000..e49b8205c Binary files /dev/null and b/assets/references/cebelnjak_orodje_set.png differ diff --git a/assets/references/corn_grow_sheet.png b/assets/references/corn_grow_sheet.png new file mode 100644 index 000000000..23532fbaa Binary files /dev/null and b/assets/references/corn_grow_sheet.png differ diff --git a/assets/references/cvetenje_marihuane.png b/assets/references/cvetenje_marihuane.png new file mode 100644 index 000000000..3dc44c39c Binary files /dev/null and b/assets/references/cvetenje_marihuane.png differ diff --git a/assets/references/delovna_miza.png b/assets/references/delovna_miza.png new file mode 100644 index 000000000..3d203a7fe Binary files /dev/null and b/assets/references/delovna_miza.png differ diff --git a/assets/references/dr_krnic.png b/assets/references/dr_krnic.png new file mode 100644 index 000000000..541e8b46f Binary files /dev/null and b/assets/references/dr_krnic.png differ diff --git a/assets/references/drevesce.png b/assets/references/drevesce.png new file mode 100644 index 000000000..15da4b622 Binary files /dev/null and b/assets/references/drevesce.png differ diff --git a/assets/references/drevo_faza_1.png b/assets/references/drevo_faza_1.png new file mode 100644 index 000000000..9e0800035 Binary files /dev/null and b/assets/references/drevo_faza_1.png differ diff --git a/assets/references/drevo_faza_2.png b/assets/references/drevo_faza_2.png new file mode 100644 index 000000000..e8edbff71 Binary files /dev/null and b/assets/references/drevo_faza_2.png differ diff --git a/assets/references/drevo_majhno.png b/assets/references/drevo_majhno.png new file mode 100644 index 000000000..16e46e68d Binary files /dev/null and b/assets/references/drevo_majhno.png differ diff --git a/assets/references/drevo_srednje.png b/assets/references/drevo_srednje.png new file mode 100644 index 000000000..596cff695 Binary files /dev/null and b/assets/references/drevo_srednje.png differ diff --git a/assets/references/drevo_veliko.png b/assets/references/drevo_veliko.png new file mode 100644 index 000000000..f388f3118 Binary files /dev/null and b/assets/references/drevo_veliko.png differ diff --git a/assets/references/druzina_portret.png b/assets/references/druzina_portret.png new file mode 100644 index 000000000..c8fc2090c Binary files /dev/null and b/assets/references/druzina_portret.png differ diff --git a/assets/references/duh_mame_plav.png b/assets/references/duh_mame_plav.png new file mode 100644 index 000000000..71f87f3d8 Binary files /dev/null and b/assets/references/duh_mame_plav.png differ diff --git a/assets/references/gronk_susi.png b/assets/references/gronk_susi.png new file mode 100644 index 000000000..b93b3aac1 Binary files /dev/null and b/assets/references/gronk_susi.png differ diff --git a/assets/references/ikone_rude.png b/assets/references/ikone_rude.png new file mode 100644 index 000000000..b9d07c35b Binary files /dev/null and b/assets/references/ikone_rude.png differ diff --git a/assets/references/insekti_dezevnik_polz_mravlja.png b/assets/references/insekti_dezevnik_polz_mravlja.png new file mode 100644 index 000000000..e964fca1d Binary files /dev/null and b/assets/references/insekti_dezevnik_polz_mravlja.png differ diff --git a/assets/references/insekti_komar_muha.png b/assets/references/insekti_komar_muha.png new file mode 100644 index 000000000..adb7dfbd0 Binary files /dev/null and b/assets/references/insekti_komar_muha.png differ diff --git a/assets/references/insekti_matica_dezevnik_polz_set.png b/assets/references/insekti_matica_dezevnik_polz_set.png new file mode 100644 index 000000000..561aefc90 Binary files /dev/null and b/assets/references/insekti_matica_dezevnik_polz_set.png differ diff --git a/assets/references/insekti_metulji_set.png b/assets/references/insekti_metulji_set.png new file mode 100644 index 000000000..400eb04a4 Binary files /dev/null and b/assets/references/insekti_metulji_set.png differ diff --git a/assets/references/insekti_posebni_set.png b/assets/references/insekti_posebni_set.png new file mode 100644 index 000000000..d626daa25 Binary files /dev/null and b/assets/references/insekti_posebni_set.png differ diff --git a/assets/references/insekti_travnik_set.png b/assets/references/insekti_travnik_set.png new file mode 100644 index 000000000..9ed1c1221 Binary files /dev/null and b/assets/references/insekti_travnik_set.png differ diff --git a/assets/references/insekti_zima_set.png b/assets/references/insekti_zima_set.png new file mode 100644 index 000000000..7f0aa0066 Binary files /dev/null and b/assets/references/insekti_zima_set.png differ diff --git a/assets/references/item_zica_kolut.png b/assets/references/item_zica_kolut.png new file mode 100644 index 000000000..e47b50c9a Binary files /dev/null and b/assets/references/item_zica_kolut.png differ diff --git a/assets/references/kaj.png b/assets/references/kaj.png new file mode 100644 index 000000000..ac3b151e0 Binary files /dev/null and b/assets/references/kaj.png differ diff --git a/assets/references/kamen_majhen.png b/assets/references/kamen_majhen.png new file mode 100644 index 000000000..2c24eeefe Binary files /dev/null and b/assets/references/kamen_majhen.png differ diff --git a/assets/references/kamen_srednji.png b/assets/references/kamen_srednji.png new file mode 100644 index 000000000..6d1de71ba Binary files /dev/null and b/assets/references/kamen_srednji.png differ diff --git a/assets/references/koca_lesena.png b/assets/references/koca_lesena.png new file mode 100644 index 000000000..3f2aae19d Binary files /dev/null and b/assets/references/koca_lesena.png differ diff --git a/assets/references/kopica_premoga.png b/assets/references/kopica_premoga.png new file mode 100644 index 000000000..30c9cae77 Binary files /dev/null and b/assets/references/kopica_premoga.png differ diff --git a/assets/references/kosa_orozje.png b/assets/references/kosa_orozje.png new file mode 100644 index 000000000..96f15e7fb Binary files /dev/null and b/assets/references/kosa_orozje.png differ diff --git a/assets/references/kovinska_resetka.png b/assets/references/kovinska_resetka.png new file mode 100644 index 000000000..cbb3f2536 Binary files /dev/null and b/assets/references/kovinska_resetka.png differ diff --git a/assets/references/kup_smeti_guma_konzerve.png b/assets/references/kup_smeti_guma_konzerve.png new file mode 100644 index 000000000..a81869077 Binary files /dev/null and b/assets/references/kup_smeti_guma_konzerve.png differ diff --git a/assets/references/lestev_lesena.png b/assets/references/lestev_lesena.png new file mode 100644 index 000000000..4ae81e426 Binary files /dev/null and b/assets/references/lestev_lesena.png differ diff --git a/assets/references/mala_koca.png b/assets/references/mala_koca.png new file mode 100644 index 000000000..5f85a8ed9 Binary files /dev/null and b/assets/references/mala_koca.png differ diff --git a/assets/references/mama.png b/assets/references/mama.png new file mode 100644 index 000000000..cb74c30d7 Binary files /dev/null and b/assets/references/mama.png differ diff --git a/assets/references/megla_ozadje.png b/assets/references/megla_ozadje.png new file mode 100644 index 000000000..ff2b372d8 Binary files /dev/null and b/assets/references/megla_ozadje.png differ diff --git a/assets/references/mladika_ikona.png b/assets/references/mladika_ikona.png new file mode 100644 index 000000000..d777ec997 Binary files /dev/null and b/assets/references/mladika_ikona.png differ diff --git a/assets/references/motorna_kosa.png b/assets/references/motorna_kosa.png new file mode 100644 index 000000000..e6ba09bf7 Binary files /dev/null and b/assets/references/motorna_kosa.png differ diff --git a/assets/references/nacrti_zvitki.png b/assets/references/nacrti_zvitki.png new file mode 100644 index 000000000..6bd5d4113 Binary files /dev/null and b/assets/references/nacrti_zvitki.png differ diff --git a/assets/references/nagrada_kip_200_dni.png b/assets/references/nagrada_kip_200_dni.png new file mode 100644 index 000000000..bd8fbd969 Binary files /dev/null and b/assets/references/nagrada_kip_200_dni.png differ diff --git a/assets/references/netopir.png b/assets/references/netopir.png new file mode 100644 index 000000000..6d2805fa0 Binary files /dev/null and b/assets/references/netopir.png differ diff --git a/assets/references/objekt_cevi_in_kabli_set.png b/assets/references/objekt_cevi_in_kabli_set.png new file mode 100644 index 000000000..7e3b346a1 Binary files /dev/null and b/assets/references/objekt_cevi_in_kabli_set.png differ diff --git a/assets/references/objekt_elektricni_drog_predelan_svetlejsi.png b/assets/references/objekt_elektricni_drog_predelan_svetlejsi.png new file mode 100644 index 000000000..625956dc1 Binary files /dev/null and b/assets/references/objekt_elektricni_drog_predelan_svetlejsi.png differ diff --git a/assets/references/objekt_gnoj_kompost_kup.png b/assets/references/objekt_gnoj_kompost_kup.png new file mode 100644 index 000000000..ed399af17 Binary files /dev/null and b/assets/references/objekt_gnoj_kompost_kup.png differ diff --git a/assets/references/objekt_grob_odprt_zombi_postelja.png b/assets/references/objekt_grob_odprt_zombi_postelja.png new file mode 100644 index 000000000..d7d1b02de Binary files /dev/null and b/assets/references/objekt_grob_odprt_zombi_postelja.png differ diff --git a/assets/references/objekt_kompostnik_lesen.png b/assets/references/objekt_kompostnik_lesen.png new file mode 100644 index 000000000..bb9a403d7 Binary files /dev/null and b/assets/references/objekt_kompostnik_lesen.png differ diff --git a/assets/references/objekt_kontejner_smeti.png b/assets/references/objekt_kontejner_smeti.png new file mode 100644 index 000000000..1174b9378 Binary files /dev/null and b/assets/references/objekt_kontejner_smeti.png differ diff --git a/assets/references/objekt_strasilo_creepy.png b/assets/references/objekt_strasilo_creepy.png new file mode 100644 index 000000000..200dc5583 Binary files /dev/null and b/assets/references/objekt_strasilo_creepy.png differ diff --git a/assets/references/okna_vrata_tileset.png b/assets/references/okna_vrata_tileset.png new file mode 100644 index 000000000..e4a58aff3 Binary files /dev/null and b/assets/references/okna_vrata_tileset.png differ diff --git a/assets/references/orodja_nadgradnje_sekira_kramp_motika.png b/assets/references/orodja_nadgradnje_sekira_kramp_motika.png new file mode 100644 index 000000000..f62a96be2 Binary files /dev/null and b/assets/references/orodja_nadgradnje_sekira_kramp_motika.png differ diff --git a/assets/references/orodje_kramp_lopata.png b/assets/references/orodje_kramp_lopata.png new file mode 100644 index 000000000..d62fef92e Binary files /dev/null and b/assets/references/orodje_kramp_lopata.png differ diff --git a/assets/references/potato_grow_sheet.png b/assets/references/potato_grow_sheet.png new file mode 100644 index 000000000..a54cbc52e Binary files /dev/null and b/assets/references/potato_grow_sheet.png differ diff --git a/assets/references/predelovalni_stroji.png b/assets/references/predelovalni_stroji.png new file mode 100644 index 000000000..c5b5cc33a Binary files /dev/null and b/assets/references/predelovalni_stroji.png differ diff --git a/assets/references/predmeti_terariji_in_kace_set.png b/assets/references/predmeti_terariji_in_kace_set.png new file mode 100644 index 000000000..98f793e65 Binary files /dev/null and b/assets/references/predmeti_terariji_in_kace_set.png differ diff --git a/assets/references/premog_ikona.png b/assets/references/premog_ikona.png new file mode 100644 index 000000000..32445675b Binary files /dev/null and b/assets/references/premog_ikona.png differ diff --git a/assets/references/proizvodnja_sena.png b/assets/references/proizvodnja_sena.png new file mode 100644 index 000000000..9359410e8 Binary files /dev/null and b/assets/references/proizvodnja_sena.png differ diff --git a/assets/references/rast_marihuane.png b/assets/references/rast_marihuane.png new file mode 100644 index 000000000..89894ae07 Binary files /dev/null and b/assets/references/rast_marihuane.png differ diff --git a/assets/references/rastlina_konoplja_faze_rasti_v_loncih.png b/assets/references/rastlina_konoplja_faze_rasti_v_loncih.png new file mode 100644 index 000000000..29ba21ee8 Binary files /dev/null and b/assets/references/rastlina_konoplja_faze_rasti_v_loncih.png differ diff --git a/assets/references/resource_mivka_in_potok_tile.png b/assets/references/resource_mivka_in_potok_tile.png new file mode 100644 index 000000000..092052d56 Binary files /dev/null and b/assets/references/resource_mivka_in_potok_tile.png differ diff --git a/assets/references/rudnik_rov.png b/assets/references/rudnik_rov.png new file mode 100644 index 000000000..c8344174b Binary files /dev/null and b/assets/references/rudnik_rov.png differ diff --git a/assets/references/rudnik_vhod_dolina_smrti.png b/assets/references/rudnik_vhod_dolina_smrti.png new file mode 100644 index 000000000..cc6078848 Binary files /dev/null and b/assets/references/rudnik_vhod_dolina_smrti.png differ diff --git a/assets/references/seed_packet_cannabis.png b/assets/references/seed_packet_cannabis.png new file mode 100644 index 000000000..858debe27 Binary files /dev/null and b/assets/references/seed_packet_cannabis.png differ diff --git a/assets/references/seme_kalcek.png b/assets/references/seme_kalcek.png new file mode 100644 index 000000000..ae9910ea6 Binary files /dev/null and b/assets/references/seme_kalcek.png differ diff --git a/assets/references/sencna_posast.png b/assets/references/sencna_posast.png new file mode 100644 index 000000000..a4b2b2309 Binary files /dev/null and b/assets/references/sencna_posast.png differ diff --git a/assets/references/sistem_za_vodo.png b/assets/references/sistem_za_vodo.png new file mode 100644 index 000000000..0b59b10c8 Binary files /dev/null and b/assets/references/sistem_za_vodo.png differ diff --git a/assets/references/skedenj.png b/assets/references/skedenj.png new file mode 100644 index 000000000..efe095d5e Binary files /dev/null and b/assets/references/skedenj.png differ diff --git a/assets/references/soba_z_rastlinami.png b/assets/references/soba_z_rastlinami.png new file mode 100644 index 000000000..ce97169b9 Binary files /dev/null and b/assets/references/soba_z_rastlinami.png differ diff --git a/assets/references/sod_izometricen.png b/assets/references/sod_izometricen.png new file mode 100644 index 000000000..de7ef77db Binary files /dev/null and b/assets/references/sod_izometricen.png differ diff --git a/assets/references/soncnice_faze_rasti.png b/assets/references/soncnice_faze_rasti.png new file mode 100644 index 000000000..71efd0c51 Binary files /dev/null and b/assets/references/soncnice_faze_rasti.png differ diff --git a/assets/references/sotor_zaprt.png b/assets/references/sotor_zaprt.png new file mode 100644 index 000000000..6753c20d3 Binary files /dev/null and b/assets/references/sotor_zaprt.png differ diff --git a/assets/references/sova.png b/assets/references/sova.png new file mode 100644 index 000000000..534962209 Binary files /dev/null and b/assets/references/sova.png differ diff --git a/assets/references/spalna_vreca.png b/assets/references/spalna_vreca.png new file mode 100644 index 000000000..6d5797d3f Binary files /dev/null and b/assets/references/spalna_vreca.png differ diff --git a/assets/references/spomini_otrostva.png b/assets/references/spomini_otrostva.png new file mode 100644 index 000000000..748790679 Binary files /dev/null and b/assets/references/spomini_otrostva.png differ diff --git a/assets/references/stara_fotografija.png b/assets/references/stara_fotografija.png new file mode 100644 index 000000000..cb67860fc Binary files /dev/null and b/assets/references/stara_fotografija.png differ diff --git a/assets/references/stor.png b/assets/references/stor.png new file mode 100644 index 000000000..374be553e Binary files /dev/null and b/assets/references/stor.png differ diff --git a/assets/references/structure_workshop_garage.png b/assets/references/structure_workshop_garage.png new file mode 100644 index 000000000..4f89e52d0 Binary files /dev/null and b/assets/references/structure_workshop_garage.png differ diff --git a/assets/references/suho_drevo.png b/assets/references/suho_drevo.png new file mode 100644 index 000000000..6d1c20ac6 Binary files /dev/null and b/assets/references/suho_drevo.png differ diff --git a/assets/references/taborni_ogenj.png b/assets/references/taborni_ogenj.png new file mode 100644 index 000000000..499f1c632 Binary files /dev/null and b/assets/references/taborni_ogenj.png differ diff --git a/assets/references/tla_in_stene.png b/assets/references/tla_in_stene.png new file mode 100644 index 000000000..78aa9cc14 Binary files /dev/null and b/assets/references/tla_in_stene.png differ diff --git a/assets/references/tla_trava_tekstura.png b/assets/references/tla_trava_tekstura.png new file mode 100644 index 000000000..26f154453 Binary files /dev/null and b/assets/references/tla_trava_tekstura.png differ diff --git a/assets/references/trava_sop.png b/assets/references/trava_sop.png new file mode 100644 index 000000000..eb97bfab5 Binary files /dev/null and b/assets/references/trava_sop.png differ diff --git a/assets/references/ui_dnevnik.png b/assets/references/ui_dnevnik.png new file mode 100644 index 000000000..ee1aaf76f Binary files /dev/null and b/assets/references/ui_dnevnik.png differ diff --git a/assets/references/ui_gumbi.png b/assets/references/ui_gumbi.png new file mode 100644 index 000000000..f75e5ea98 Binary files /dev/null and b/assets/references/ui_gumbi.png differ diff --git a/assets/references/ui_okno_leseno.png b/assets/references/ui_okno_leseno.png new file mode 100644 index 000000000..391127075 Binary files /dev/null and b/assets/references/ui_okno_leseno.png differ diff --git a/assets/references/ui_status_bar.png b/assets/references/ui_status_bar.png new file mode 100644 index 000000000..7a7d23451 Binary files /dev/null and b/assets/references/ui_status_bar.png differ diff --git a/assets/references/ui_vrstica_napredka.png b/assets/references/ui_vrstica_napredka.png new file mode 100644 index 000000000..bb3cfa6f4 Binary files /dev/null and b/assets/references/ui_vrstica_napredka.png differ diff --git a/assets/references/unnamed-1.png b/assets/references/unnamed-1.png new file mode 100644 index 000000000..e7acb17f3 Binary files /dev/null and b/assets/references/unnamed-1.png differ diff --git a/assets/references/unnamed-10.png b/assets/references/unnamed-10.png new file mode 100644 index 000000000..a91f19308 Binary files /dev/null and b/assets/references/unnamed-10.png differ diff --git a/assets/references/unnamed-12.png b/assets/references/unnamed-12.png new file mode 100644 index 000000000..4a3b1381e Binary files /dev/null and b/assets/references/unnamed-12.png differ diff --git a/assets/references/unnamed-2.png b/assets/references/unnamed-2.png new file mode 100644 index 000000000..bf4b9a29e Binary files /dev/null and b/assets/references/unnamed-2.png differ diff --git a/assets/references/unnamed-3.png b/assets/references/unnamed-3.png new file mode 100644 index 000000000..8de403dde Binary files /dev/null and b/assets/references/unnamed-3.png differ diff --git a/assets/references/unnamed-4.png b/assets/references/unnamed-4.png new file mode 100644 index 000000000..72621070d Binary files /dev/null and b/assets/references/unnamed-4.png differ diff --git a/assets/references/unnamed-5.png b/assets/references/unnamed-5.png new file mode 100644 index 000000000..69687f03b Binary files /dev/null and b/assets/references/unnamed-5.png differ diff --git a/assets/references/unnamed-6.png b/assets/references/unnamed-6.png new file mode 100644 index 000000000..e3df9be37 Binary files /dev/null and b/assets/references/unnamed-6.png differ diff --git a/assets/references/unnamed-7.png b/assets/references/unnamed-7.png new file mode 100644 index 000000000..8d98272fc Binary files /dev/null and b/assets/references/unnamed-7.png differ diff --git a/assets/references/unnamed-8.png b/assets/references/unnamed-8.png new file mode 100644 index 000000000..f5ed90fec Binary files /dev/null and b/assets/references/unnamed-8.png differ diff --git a/assets/references/unnamed-9.png b/assets/references/unnamed-9.png new file mode 100644 index 000000000..42917daea Binary files /dev/null and b/assets/references/unnamed-9.png differ diff --git a/assets/references/unnamed.png b/assets/references/unnamed.png new file mode 100644 index 000000000..ab0d2ea33 Binary files /dev/null and b/assets/references/unnamed.png differ diff --git a/assets/references/vhod_rudnik_1_zrušen.png b/assets/references/vhod_rudnik_1_zrušen.png new file mode 100644 index 000000000..7c9c216ce Binary files /dev/null and b/assets/references/vhod_rudnik_1_zrušen.png differ diff --git a/assets/references/vhod_rudnik_2_popravljen.png b/assets/references/vhod_rudnik_2_popravljen.png new file mode 100644 index 000000000..7d5cc6ee6 Binary files /dev/null and b/assets/references/vhod_rudnik_2_popravljen.png differ diff --git a/assets/references/visoka_trava.png b/assets/references/visoka_trava.png new file mode 100644 index 000000000..ea80f95ac Binary files /dev/null and b/assets/references/visoka_trava.png differ diff --git a/assets/references/vodnjak.png b/assets/references/vodnjak.png new file mode 100644 index 000000000..5d094e882 Binary files /dev/null and b/assets/references/vodnjak.png differ diff --git a/assets/references/vodnjak_star.png b/assets/references/vodnjak_star.png new file mode 100644 index 000000000..16bc53cbb Binary files /dev/null and b/assets/references/vodnjak_star.png differ diff --git a/assets/references/wheat_grow_sheet.png b/assets/references/wheat_grow_sheet.png new file mode 100644 index 000000000..dd6ac8d28 Binary files /dev/null and b/assets/references/wheat_grow_sheet.png differ diff --git a/assets/references/zareca_ruda.png b/assets/references/zareca_ruda.png new file mode 100644 index 000000000..88550c3a2 Binary files /dev/null and b/assets/references/zareca_ruda.png differ diff --git a/assets/references/zgradba_kurnik.png b/assets/references/zgradba_kurnik.png new file mode 100644 index 000000000..7bda3ff12 Binary files /dev/null and b/assets/references/zgradba_kurnik.png differ diff --git a/assets/references/zgradba_pec_cela_in_podrta.png b/assets/references/zgradba_pec_cela_in_podrta.png new file mode 100644 index 000000000..82cd72e92 Binary files /dev/null and b/assets/references/zgradba_pec_cela_in_podrta.png differ diff --git a/assets/references/zgradba_rastlinjak_namakanje.png b/assets/references/zgradba_rastlinjak_namakanje.png new file mode 100644 index 000000000..a65903d19 Binary files /dev/null and b/assets/references/zgradba_rastlinjak_namakanje.png differ diff --git a/assets/references/zival_kokosi_vse_barve.png b/assets/references/zival_kokosi_vse_barve.png new file mode 100644 index 000000000..d54cbbe27 Binary files /dev/null and b/assets/references/zival_kokosi_vse_barve.png differ diff --git a/assets/references/zivali_divje_predelane_svetlejsa.png b/assets/references/zivali_divje_predelane_svetlejsa.png new file mode 100644 index 000000000..01ebdf07d Binary files /dev/null and b/assets/references/zivali_divje_predelane_svetlejsa.png differ diff --git a/assets/references/zivali_krava_svinja_ovca.png b/assets/references/zivali_krava_svinja_ovca.png new file mode 100644 index 000000000..735668878 Binary files /dev/null and b/assets/references/zivali_krava_svinja_ovca.png differ diff --git a/assets/references/zivali_ribe_vse_vrste_set.png b/assets/references/zivali_ribe_vse_vrste_set.png new file mode 100644 index 000000000..f6f4f7fe2 Binary files /dev/null and b/assets/references/zivali_ribe_vse_vrste_set.png differ diff --git a/assets/references/zlomjena_ograja.png b/assets/references/zlomjena_ograja.png new file mode 100644 index 000000000..14b3ce076 Binary files /dev/null and b/assets/references/zlomjena_ograja.png differ diff --git a/assets/references/znak_smerokaz_mesto_gozd.png b/assets/references/znak_smerokaz_mesto_gozd.png new file mode 100644 index 000000000..f47c6178d Binary files /dev/null and b/assets/references/znak_smerokaz_mesto_gozd.png differ diff --git a/assets/references/znak_viseci_prazna_tabla.png b/assets/references/znak_viseci_prazna_tabla.png new file mode 100644 index 000000000..1fcdb91b5 Binary files /dev/null and b/assets/references/znak_viseci_prazna_tabla.png differ diff --git a/assets/references/zombi.png b/assets/references/zombi.png new file mode 100644 index 000000000..92e67154e Binary files /dev/null and b/assets/references/zombi.png differ diff --git a/assets/references/zombi_izvidnik.png b/assets/references/zombi_izvidnik.png new file mode 100644 index 000000000..3dc089e19 Binary files /dev/null and b/assets/references/zombi_izvidnik.png differ diff --git a/assets/references/zombi_kmet.png b/assets/references/zombi_kmet.png new file mode 100644 index 000000000..04948f181 Binary files /dev/null and b/assets/references/zombi_kmet.png differ diff --git a/assets/references/zombi_otrok.png b/assets/references/zombi_otrok.png new file mode 100644 index 000000000..cdf0a692d Binary files /dev/null and b/assets/references/zombi_otrok.png differ diff --git a/assets/references/zombi_otrok_punca.png b/assets/references/zombi_otrok_punca.png new file mode 100644 index 000000000..92470faca Binary files /dev/null and b/assets/references/zombi_otrok_punca.png differ diff --git a/assets/references/zombi_rudar.png b/assets/references/zombi_rudar.png new file mode 100644 index 000000000..79044f9a5 Binary files /dev/null and b/assets/references/zombi_rudar.png differ diff --git a/assets/references/zombie_punk.png b/assets/references/zombie_punk.png new file mode 100644 index 000000000..351282de0 Binary files /dev/null and b/assets/references/zombie_punk.png differ diff --git a/scripts/utils/convert_desktop_jpg_to_png.py b/scripts/utils/convert_desktop_jpg_to_png.py new file mode 100644 index 000000000..fe9c7373d --- /dev/null +++ b/scripts/utils/convert_desktop_jpg_to_png.py @@ -0,0 +1,41 @@ +import os +import subprocess + +TARGET_DIR = "/Users/davidkotnik/Desktop/referencne slike 2" + +def convert_images(): + if not os.path.exists(TARGET_DIR): + print(f"Error: Directory {TARGET_DIR} does not exist.") + return + + files = [f for f in os.listdir(TARGET_DIR) if f.lower().endswith(('.jpg', '.jpeg'))] + + if not files: + print("No JPG images found to convert.") + return + + print(f"Found {len(files)} JPG images. Starting conversion...") + + for filename in files: + filepath = os.path.join(TARGET_DIR, filename) + name_without_ext = os.path.splitext(filename)[0] + new_filename = name_without_ext + ".png" + new_filepath = os.path.join(TARGET_DIR, new_filename) + + # Skip if png already exists to save time? + # User said "first convert", implyng they might not exist. + # But let's overwrite to be sure we have fresh versions if needed. + + try: + # Using macOS built-in sips tool + subprocess.run( + ["sips", "-s", "format", "png", filepath, "--out", new_filepath], + check=True, + stdout=subprocess.DEVNULL # Silence standard output for cleaner logs + ) + print(f"✅ Converted: {filename} -> {new_filename}") + except subprocess.CalledProcessError as e: + print(f"❌ Failed to convert {filename}: {e}") + +if __name__ == "__main__": + convert_images() diff --git a/scripts/utils/intelligent_resize.py b/scripts/utils/intelligent_resize.py new file mode 100644 index 000000000..9dc2108ed --- /dev/null +++ b/scripts/utils/intelligent_resize.py @@ -0,0 +1,122 @@ +import os +import sys +import subprocess + +SOURCE_DIR = "/Users/davidkotnik/Desktop/referencne slike 2" + +# --- CONFIGURATION: LOGIC FOR RESIZING --- +# We define max dimension (width or height, whichever is larger). +# The aspect ratio is always preserved. + +RESIZE_RULES = [ + # --- MASSIVE (512px - 600px) --- + # Buildings, large trees, Gronk (Giant Troll) + { + "keywords": ["zgradba", "hisa", "skedenj", "drevo_veliko", "gronk", "troll", "structure", "objekt", "rudnik", "vhod"], + "size": 512 + }, + + # --- MEDIUM-LARGE (350px - 400px) --- + # Regular trees, large animals, vehicles + { + "keywords": ["drevo", "krava", "konj", "medved", "auto", "traktor", "agregat", "sod", "kontejner", "vodnjak", "koca", "sotor"], + "size": 384 + }, + + # --- MEDIUM (Standard Character Size: 256px) --- + # Humans, zombies, standard props, furniture + { + "keywords": ["zombi", "kai", "ana", "ata", "mama", "love", "character", "kip", "postelja", "vreca", "miza", "stol", "klop", "kamen_srednji", "ograja"], + "size": 256 + }, + + # --- SMALL-MEDIUM (128px - 192px) --- + # Small animals, dogs, inventory items held in hand + { + "keywords": ["pes", "susi", "macka", "kokos", "zajec", "svinja", "ovca", "orodje", "kramp", "sekira", "motika", "lopata", "meč", "puska", "kamen", "grm", "trava"], + "size": 192 + }, + + # --- SMALL (64px - 96px) --- + # Insects, small items, icons, UI elements + { + "keywords": ["insekt", "mravlja", "cebela", "metulj", "hrosc", "muha", "komar", "polz", "dezevnik", "ikona", "item", "seme", "steklenica", "hrana", "ui", "gumb"], + "size": 96 + } +] + +DEFAULT_SIZE = 256 # Fallback size if no keyword matches + +def install_dependencies(): + pass # Pillow should be installed from previous step + +def get_target_size(filename): + """Determine size based on filename keywords.""" + fname = filename.lower() + + for rule in RESIZE_RULES: + for keyword in rule["keywords"]: + if keyword in fname: + # Special case logic could go here (e.g. "zombi_otrok" smaller than "zombi") + if "otrok" in fname and rule["size"] > 128: + return int(rule["size"] * 0.7) # Kids are 70% size + return rule["size"] + + return DEFAULT_SIZE + +def intelligent_resize(): + if not os.path.exists(SOURCE_DIR): + print(f"Directory not found: {SOURCE_DIR}") + return + + try: + from PIL import Image + except ImportError: + print("PIL/Pillow not found. Please pip install Pillow.") + return + + files = [f for f in os.listdir(SOURCE_DIR) if f.lower().endswith('.png')] + if not files: + print("No PNG files found.") + return + + print(f"Found {len(files)} PNGs. Starting intelligent resizing...") + + for filename in files: + filepath = os.path.join(SOURCE_DIR, filename) + + try: + target_size = get_target_size(filename) + + with Image.open(filepath) as img: + # Calculate new size preserving aspect ratio + width, height = img.size + aspect_ratio = width / height + + if width > height: + new_width = target_size + new_height = int(target_size / aspect_ratio) + else: + new_height = target_size + new_width = int(target_size * aspect_ratio) + + # High quality resampling + resized_img = img.resize((new_width, new_height), Image.Resampling.LANCZOS) + + # Apply Sharpening (Unsharp Mask) to keep details (piercings!) crisp + # Radius 2, Percent 150 is a good standard for "Concept Art" sharpness + try: + from PIL import ImageFilter + resized_img = resized_img.filter(ImageFilter.UnsharpMask(radius=1.5, percent=130, threshold=3)) + except ImportError: + pass # Should be in PIL + + # Save + resized_img.save(filepath) + print(f"✅ Resized {filename}: {width}x{height} -> {new_width}x{new_height} (Target: {target_size}px)") + + except Exception as e: + print(f"❌ Error resizing {filename}: {e}") + +if __name__ == "__main__": + intelligent_resize() diff --git a/scripts/utils/organize_final_assets.py b/scripts/utils/organize_final_assets.py new file mode 100644 index 000000000..e8eb1e7af --- /dev/null +++ b/scripts/utils/organize_final_assets.py @@ -0,0 +1,63 @@ +import os +import shutil + +# Source of Truth +SOURCE_DIR = "/Users/davidkotnik/repos/novafarma/assets/references" +BASE_ASSETS_DIR = "/Users/davidkotnik/repos/novafarma/assets" + +# Define Categories +CATEGORIES = { + "zombies": ["zombi", "zombie", "undead"], + "characters": ["kai", "ana", "ata", "mama", "gronk", "dr_krnic", "character", "npc"], + "animals": ["krava", "svinja", "ovca", "kokos", "pes", "susi", "macka", "netopir", "sova", "volk", "medved", "zival", "insekt", "metulj", "mravlja", "cebela", "polz", "dezevnik", "hrosc", "komar", "muha"], + "ui": ["ui_", "gumb", "ikona", "okno", "bar", "status", "dnevnik", "inventar", "kazalec"], + "items": ["orodje", "kramp", "lopata", "sekira", "motika", "kosa", "mec", "puska", "stikalo", "sod", "bencin", "kanister", "seme", "rastlina", "pridelki", "marihuana", "konoplja", "hrana", "steklenica", "nacrt", "zvitki"], + "environment": ["drevo", "trava", "kamen", "grm", "tile", "tla", "pot", "rudnik", "vhod", "megla", "ozadje", "voda", "resource", "zgradba", "hisa", "koca", "sotor", "skedenj", "objekt", "vodnjak", "ograja", "kip", "postelja", "vreca", "miza", "stol", "klop"] +} + +def organize_assets(): + # 1. Create Directories + for category in CATEGORIES: + path = os.path.join(BASE_ASSETS_DIR, category) + if not os.path.exists(path): + os.makedirs(path) + print(f"Created directory: {category}") + + # 2. Sort Files + files = [f for f in os.listdir(SOURCE_DIR) if f.lower().endswith('.png')] + + print(f"Sorting {len(files)} files from references...") + + count = 0 + for filename in files: + src_path = os.path.join(SOURCE_DIR, filename) + fname_lower = filename.lower() + + assigned = False + + # Check categories in specific order (Zombies first as requested!) + # Use lists to prioritize: Zombies > Characters > Animals > UI > Items > Environment + priority_order = ["zombies", "characters", "animals", "ui", "items", "environment"] + + for category in priority_order: + keywords = CATEGORIES[category] + if any(k in fname_lower for k in keywords): + dst_path = os.path.join(BASE_ASSETS_DIR, category, filename) + shutil.copy2(src_path, dst_path) # COPY, don't move (keep references safe) + # print(f"-> {category}: {filename}") + assigned = True + count += 1 + break + + if not assigned: + # Fallback to 'environment' or 'misc' if unsure? + # Let's put in 'environment' as catch-all or create 'misc' + dst_path = os.path.join(BASE_ASSETS_DIR, "environment", filename) + shutil.copy2(src_path, dst_path) + print(f"-> environment (fallback): {filename}") + count += 1 + + print(f"✅ Successfully organized {count} assets into game folders!") + +if __name__ == "__main__": + organize_assets() diff --git a/scripts/utils/remove_backgrounds.py b/scripts/utils/remove_backgrounds.py new file mode 100644 index 000000000..38b2af8f4 --- /dev/null +++ b/scripts/utils/remove_backgrounds.py @@ -0,0 +1,89 @@ +import os +import sys +import subprocess + +# Define the source directory on the Desktop +SOURCE_DIR = "/Users/davidkotnik/Desktop/referencne slike 2" + +def install_dependencies(): + """Attempt to install required packages if they are missing.""" + packages = ["rembg", "Pillow", "onnxruntime"] + for package in packages: + try: + __import__(package) + except ImportError: + if package == "Pillow": + # Pillow is imported as PIL + try: + __import__("PIL") + continue + except ImportError: + pass + + print(f"Installing {package}...") + try: + subprocess.check_call([sys.executable, "-m", "pip", "install", package]) + except subprocess.CalledProcessError as e: + print(f"Failed to install {package}: {e}") + print("Please try installing it manually: pip install rembg Pillow onnxruntime") + sys.exit(1) + +def process_images(): + # Verify directory + if not os.path.exists(SOURCE_DIR): + print(f"Error: Directory {SOURCE_DIR} not found.") + return + + # Import libraries AFTER installation + try: + from rembg import remove + from PIL import Image + except ImportError: + print("Error: Library import failed even after installation attempt.") + return + + # Get PNG files + files = [f for f in os.listdir(SOURCE_DIR) if f.lower().endswith('.png')] + total = len(files) + + if total == 0: + print("No PNG files found to process.") + return + + print(f"Found {total} PNG images. Starting AI background removal...") + print("WARNING: This makes permanent changes to the PNG files (JPG backups are safe).") + print("This might take a while depending on your computer speed.") + + success = 0 + errors = 0 + + for i, filename in enumerate(files): + file_path = os.path.join(SOURCE_DIR, filename) + + try: + print(f"[{i+1}/{total}] Processing: {filename}") + + # Open the image + with open(file_path, "rb") as input_file: + input_data = input_file.read() + + # Remove background + output_data = remove(input_data) + + # Save the result back to the same file (overwrite) + with open(file_path, "wb") as output_file: + output_file.write(output_data) + + success += 1 + + except Exception as e: + print(f"❌ Error processing {filename}: {e}") + errors += 1 + + print(f"\n--- DONE ---") + print(f"Successful: {success}") + print(f"Errors: {errors}") + +if __name__ == "__main__": + install_dependencies() + process_images()