add: preliminary work for bandages shown on amputations
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
BIN
dev_stuff/gen_amp_textures/input/bandage.png
Normal file
BIN
dev_stuff/gen_amp_textures/input/bandage.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
35
dev_stuff/gen_amp_textures/main_bnd.py
Normal file
35
dev_stuff/gen_amp_textures/main_bnd.py
Normal file
@@ -0,0 +1,35 @@
|
||||
from pathlib import Path
|
||||
from PIL import Image
|
||||
import os
|
||||
|
||||
input_bodies_path = Path('input/body')
|
||||
input_bandages_path = Path('input/bandages')
|
||||
|
||||
for body_filepath in input_bodies_path.glob('*.png'): # Only PNG files
|
||||
for bandage_filepath in input_bandages_path.glob('*.png'): # Only PNG files
|
||||
print(f'Processing {body_filepath.name} with {bandage_filepath.name}...')
|
||||
base = Image.open(body_filepath)
|
||||
overlay = Image.open(bandage_filepath)
|
||||
|
||||
body_name = body_filepath.stem.replace('MaleBody', 'skin')
|
||||
if body_name.endswith('a'):
|
||||
body_name = body_name[:-1] + '_hairy_b'
|
||||
else:
|
||||
body_name = body_name + '_b'
|
||||
|
||||
result = base.copy()
|
||||
result.paste(overlay, (0, 0), mask=overlay) # Use overlay as its own mask
|
||||
|
||||
if bandage_filepath.stem == 'MaleBody01_bandages_lower_arm':
|
||||
output_path = 'output/Bandaged/Forearm/'
|
||||
elif bandage_filepath.stem == 'MaleBody01_bandages_upper_arm':
|
||||
output_path = 'output/Bandaged/UpperArm/'
|
||||
elif bandage_filepath.stem == 'MaleBody01_bandages_lower_arm_blood':
|
||||
output_path = 'output/Bandaged_Bloody/Forearm/'
|
||||
elif bandage_filepath.stem == 'MaleBody01_bandages_upper_arm_blood':
|
||||
output_path = 'output/Bandaged_Bloody/UpperArm/'
|
||||
|
||||
|
||||
os.makedirs(output_path, exist_ok=True)
|
||||
result.save(f'{output_path}/{body_name}.png')
|
||||
|
||||
Reference in New Issue
Block a user