Redraw battle unit sprites with new style
This commit is contained in:
@@ -314,14 +314,8 @@ def stabilize_palette_image(image: Image.Image) -> Image.Image:
|
||||
image = image.convert("RGBA")
|
||||
red, green, blue, alpha = image.split()
|
||||
rgb = Image.merge("RGB", (red, green, blue))
|
||||
rgb = ImageEnhance.Color(rgb).enhance(0.76)
|
||||
rgb = ImageEnhance.Contrast(rgb).enhance(0.97)
|
||||
rgb = ImageEnhance.Brightness(rgb).enhance(0.98)
|
||||
|
||||
luma = ImageOps.grayscale(rgb)
|
||||
battlefield = ImageOps.colorize(luma, black=(22, 20, 22), white=(210, 194, 158), mid=(104, 91, 73))
|
||||
tone_mask = alpha.point(lambda value: min(46, round(value * 0.16)))
|
||||
rgb = Image.composite(battlefield, rgb, tone_mask)
|
||||
rgb = ImageEnhance.Contrast(rgb).enhance(1.01)
|
||||
rgb = ImageEnhance.Brightness(rgb).enhance(1.0)
|
||||
return Image.merge("RGBA", (*rgb.split(), alpha))
|
||||
|
||||
|
||||
@@ -552,29 +546,29 @@ def colored_mask(alpha: Image.Image, color: tuple[int, int, int, int]) -> Image.
|
||||
def style_for_unit(stem: str) -> UnitStyle:
|
||||
lower = stem.lower()
|
||||
scale = 0.98
|
||||
saturation = 0.9
|
||||
saturation = 1.0
|
||||
contrast = 1.04
|
||||
brightness = 0.98
|
||||
edge_warmth = 0.68
|
||||
brightness = 1.0
|
||||
edge_warmth = 0.9
|
||||
rim_color = (31, 25, 35)
|
||||
|
||||
if any(token in lower for token in ("archer", "crossbow", "longbow")):
|
||||
scale = 0.94
|
||||
saturation = 0.88
|
||||
saturation = 1.0
|
||||
elif any(token in lower for token in ("cavalry", "ma-chao", "ma-dai", "lu-bu")):
|
||||
scale = 1.03
|
||||
contrast = 1.05
|
||||
elif any(token in lower for token in ("strategist", "shaman", "zhuge", "sima", "fa-zheng", "ma-liang", "yi-ji")):
|
||||
scale = 0.93
|
||||
brightness = 0.99
|
||||
brightness = 1.0
|
||||
rim_color = (29, 28, 41)
|
||||
elif any(token in lower for token in ("leader", "officer", "meng-huo", "guan-yu", "zhang-fei", "jiang-wei")):
|
||||
scale = 1.01
|
||||
contrast = 1.05
|
||||
edge_warmth = 0.78
|
||||
edge_warmth = 0.98
|
||||
|
||||
if "nanman" in lower or "meng-huo" in lower:
|
||||
saturation = 0.92
|
||||
saturation = 1.0
|
||||
rim_color = (38, 28, 34)
|
||||
elif "wu-" in lower or "lu-meng" in lower:
|
||||
rim_color = (25, 31, 37)
|
||||
|
||||
Reference in New Issue
Block a user