Claimed floors back to fitted flagstones in the masters' colours with damage; high-res floor decals
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
362f4e7670
commit
ca8494aea0
51 files changed
+154
-39
No files matched your search
+5
-2
@@ -2,7 +2,7 @@
|
||||
"""Turn a generated texture into a seamless pixel-art tile sheet for the high-res atlas.
|
||||
|
||||
Usage:
|
||||
make_tile.py raw.png out_prefix [--size 128] [--colors 32] [--band 14] [--variants N]
|
||||
make_tile.py raw.png out_prefix [--size 128] [--colors 32] [--band 14] [--variants N] [--bright F]
|
||||
|
||||
The picture is scaled down to size x size (default 128: a 2x2 block of 64x64 tiles; the game
|
||||
lays the four quarters out by the tiles' positions, so the floor repeats only every two tiles),
|
||||
@@ -20,7 +20,7 @@ out_prefix-v<tile>-preview.png (a floor of them laid out at random). Needs Pillo
|
||||
import argparse
|
||||
import random
|
||||
|
||||
from PIL import Image, ImageChops
|
||||
from PIL import Image, ImageChops, ImageEnhance
|
||||
|
||||
|
||||
def seamless(img, band):
|
||||
@@ -75,12 +75,15 @@ def main():
|
||||
ap.add_argument("--colors", type=int, default=32)
|
||||
ap.add_argument("--band", type=int, default=14)
|
||||
ap.add_argument("--variants", type=int, default=0)
|
||||
ap.add_argument("--bright", type=float, default=1.0)
|
||||
a = ap.parse_args()
|
||||
|
||||
img = Image.open(a.raw).convert("RGB")
|
||||
s = min(img.size)
|
||||
img = img.crop(((img.width - s) // 2, (img.height - s) // 2, (img.width + s) // 2, (img.height + s) // 2))
|
||||
img = img.resize((a.size, a.size), Image.LANCZOS)
|
||||
if a.bright != 1.0:
|
||||
img = ImageEnhance.Brightness(img).enhance(a.bright)
|
||||
img = seamless(img, a.band)
|
||||
if a.variants:
|
||||
return variants(img, a)
|
||||
|
||||
Reference in new issue
Block a user