feat: revert pixel 0,0,0,0 preprocess
This commit is contained in:
1 parent
75bb4ae9d1
commit
f25f6b0124
1 file changed
+5
@@ -534,6 +534,11 @@ def main():
|
|||||||
img = Image.open(f"data/images/{args.character}.png")
|
img = Image.open(f"data/images/{args.character}.png")
|
||||||
img = img.convert('RGBA')
|
img = img.convert('RGBA')
|
||||||
ow, oh = img.size
|
ow, oh = img.size
|
||||||
|
for i, px in enumerate(img.getdata()):
|
||||||
|
if px[3] <= 0:
|
||||||
|
y = i // ow
|
||||||
|
x = i % ow
|
||||||
|
img.putpixel((x, y), (0, 0, 0, 0))
|
||||||
if ow != 512 or oh != 512:
|
if ow != 512 or oh != 512:
|
||||||
img = resize_to_512_center(img)
|
img = resize_to_512_center(img)
|
||||||
if args.alpha_clean:
|
if args.alpha_clean:
|
||||||
|
|||||||
Reference in new issue
Block a user