add: better wound textures
@@ -10,15 +10,30 @@
|
|||||||
<m_MasksFolder>none</m_MasksFolder>
|
<m_MasksFolder>none</m_MasksFolder>
|
||||||
|
|
||||||
<!-- HUMAN -->
|
<!-- HUMAN -->
|
||||||
<textureChoices>Amputations\Human\Forearm\skin01_b</textureChoices>
|
<textureChoices>Amputations\Human\Hand\skin01_b</textureChoices>
|
||||||
<textureChoices>Amputations\Human\Forearm\skin02_b</textureChoices>
|
<textureChoices>Amputations\Human\Hand\skin02_b</textureChoices>
|
||||||
<textureChoices>Amputations\Human\Forearm\skin03_b</textureChoices>
|
<textureChoices>Amputations\Human\Hand\skin03_b</textureChoices>
|
||||||
<textureChoices>Amputations\Human\Forearm\skin04_b</textureChoices>
|
<textureChoices>Amputations\Human\Hand\skin04_b</textureChoices>
|
||||||
<textureChoices>Amputations\Human\Forearm\skin05_b</textureChoices>
|
<textureChoices>Amputations\Human\Hand\skin05_b</textureChoices>
|
||||||
|
|
||||||
|
<textureChoices>Amputations\Human\Hand\skin01_hairy_b</textureChoices>
|
||||||
|
<textureChoices>Amputations\Human\Hand\skin02_hairy_b</textureChoices>
|
||||||
|
<textureChoices>Amputations\Human\Hand\skin03_hairy_b</textureChoices>
|
||||||
|
<textureChoices>Amputations\Human\Hand\skin04_hairy_b</textureChoices>
|
||||||
|
<textureChoices>Amputations\Human\Hand\skin05_hairy_b</textureChoices>
|
||||||
|
|
||||||
|
<!-- HUMAN AFTER CICATRIZATION -->
|
||||||
|
|
||||||
|
<textureChoices>Body\MaleBody01</textureChoices>
|
||||||
|
<textureChoices>Body\MaleBody02</textureChoices>
|
||||||
|
<textureChoices>Body\MaleBody03</textureChoices>
|
||||||
|
<textureChoices>Body\MaleBody04</textureChoices>
|
||||||
|
<textureChoices>Body\MaleBody05</textureChoices>
|
||||||
|
|
||||||
|
<textureChoices>Body\MaleBody01a</textureChoices>
|
||||||
|
<textureChoices>Body\MaleBody02a</textureChoices>
|
||||||
|
<textureChoices>Body\MaleBody03a</textureChoices>
|
||||||
|
<textureChoices>Body\MaleBody04</textureChoices>
|
||||||
|
<textureChoices>Body\MaleBody05a</textureChoices>
|
||||||
|
|
||||||
<textureChoices>Amputations\Human\Forearm\skin01_hairy_b</textureChoices>
|
|
||||||
<textureChoices>Amputations\Human\Forearm\skin02_hairy_b</textureChoices>
|
|
||||||
<textureChoices>Amputations\Human\Forearm\skin03_hairy_b</textureChoices>
|
|
||||||
<textureChoices>Amputations\Human\Forearm\skin04_hairy_b</textureChoices>
|
|
||||||
<textureChoices>Amputations\Human\Forearm\skin05_hairy_b</textureChoices>
|
|
||||||
</clothingItem>
|
</clothingItem>
|
||||||
@@ -9,15 +9,29 @@
|
|||||||
<m_MasksFolder>none</m_MasksFolder>
|
<m_MasksFolder>none</m_MasksFolder>
|
||||||
|
|
||||||
<!-- HUMAN -->
|
<!-- HUMAN -->
|
||||||
<textureChoices>Amputations\Human\Forearm\skin01_b</textureChoices>
|
<textureChoices>Amputations\Human\Hand\skin01_b</textureChoices>
|
||||||
<textureChoices>Amputations\Human\Forearm\skin02_b</textureChoices>
|
<textureChoices>Amputations\Human\Hand\skin02_b</textureChoices>
|
||||||
<textureChoices>Amputations\Human\Forearm\skin03_b</textureChoices>
|
<textureChoices>Amputations\Human\Hand\skin03_b</textureChoices>
|
||||||
<textureChoices>Amputations\Human\Forearm\skin04_b</textureChoices>
|
<textureChoices>Amputations\Human\Hand\skin04_b</textureChoices>
|
||||||
<textureChoices>Amputations\Human\Forearm\skin05_b</textureChoices>
|
<textureChoices>Amputations\Human\Hand\skin05_b</textureChoices>
|
||||||
|
|
||||||
<textureChoices>Amputations\Human\Forearm\skin01_hairy_b</textureChoices>
|
<textureChoices>Amputations\Human\Hand\skin01_hairy_b</textureChoices>
|
||||||
<textureChoices>Amputations\Human\Forearm\skin02_hairy_b</textureChoices>
|
<textureChoices>Amputations\Human\Hand\skin02_hairy_b</textureChoices>
|
||||||
<textureChoices>Amputations\Human\Forearm\skin03_hairy_b</textureChoices>
|
<textureChoices>Amputations\Human\Hand\skin03_hairy_b</textureChoices>
|
||||||
<textureChoices>Amputations\Human\Forearm\skin04_hairy_b</textureChoices>
|
<textureChoices>Amputations\Human\Hand\skin04_hairy_b</textureChoices>
|
||||||
<textureChoices>Amputations\Human\Forearm\skin05_hairy_b</textureChoices>
|
<textureChoices>Amputations\Human\Hand\skin05_hairy_b</textureChoices>
|
||||||
|
|
||||||
|
<!-- HUMAN AFTER CICATRIZATION -->
|
||||||
|
|
||||||
|
<textureChoices>Body\MaleBody01</textureChoices>
|
||||||
|
<textureChoices>Body\MaleBody02</textureChoices>
|
||||||
|
<textureChoices>Body\MaleBody03</textureChoices>
|
||||||
|
<textureChoices>Body\MaleBody04</textureChoices>
|
||||||
|
<textureChoices>Body\MaleBody05</textureChoices>
|
||||||
|
|
||||||
|
<textureChoices>Body\MaleBody01a</textureChoices>
|
||||||
|
<textureChoices>Body\MaleBody02a</textureChoices>
|
||||||
|
<textureChoices>Body\MaleBody03a</textureChoices>
|
||||||
|
<textureChoices>Body\MaleBody04</textureChoices>
|
||||||
|
<textureChoices>Body\MaleBody05a</textureChoices>
|
||||||
</clothingItem>
|
</clothingItem>
|
||||||
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 55 KiB |
BIN
common/media/textures/Amputations/Human/Hand/skin01_b.png
Normal file
|
After Width: | Height: | Size: 51 KiB |
BIN
common/media/textures/Amputations/Human/Hand/skin01_hairy_b.png
Normal file
|
After Width: | Height: | Size: 75 KiB |
BIN
common/media/textures/Amputations/Human/Hand/skin02_b.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
common/media/textures/Amputations/Human/Hand/skin02_hairy_b.png
Normal file
|
After Width: | Height: | Size: 76 KiB |
BIN
common/media/textures/Amputations/Human/Hand/skin03_b.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
common/media/textures/Amputations/Human/Hand/skin03_hairy_b.png
Normal file
|
After Width: | Height: | Size: 67 KiB |
BIN
common/media/textures/Amputations/Human/Hand/skin04_b.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
common/media/textures/Amputations/Human/Hand/skin04_hairy_b.png
Normal file
|
After Width: | Height: | Size: 59 KiB |
BIN
common/media/textures/Amputations/Human/Hand/skin05_b.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
common/media/textures/Amputations/Human/Hand/skin05_hairy_b.png
Normal file
|
After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 83 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 55 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.4 KiB |
@@ -1,46 +1,65 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
import os
|
||||||
|
|
||||||
input_bodies_path = Path('input/body')
|
input_bodies_path = Path('input/body')
|
||||||
input_wound_texture = Path('input/wound.png')
|
input_wound_texture = Path('input/wound.png')
|
||||||
# 48, 33 TEXTURE
|
# 45, 33 TEXTURE
|
||||||
|
|
||||||
|
|
||||||
# 256,256
|
# 256,256
|
||||||
|
|
||||||
IMG_WIDTH = 256
|
IMG_WIDTH = 256
|
||||||
|
|
||||||
|
|
||||||
COORDS_L = {
|
COORDS_L = {
|
||||||
#"H": (0, 115),
|
"H": (2, 100),
|
||||||
"F": (0, 59),
|
"F": (2, 59),
|
||||||
"U": (0,21),
|
"U": (2,21),
|
||||||
}
|
}
|
||||||
|
|
||||||
COORDS_R = {
|
COORDS_R = {
|
||||||
#"H": (IMG_WIDTH - 50- COORDS_L['H'][0], COORDS_L['H'][1]),
|
"H": (IMG_WIDTH - 43- COORDS_L['H'][0], COORDS_L['H'][1]),
|
||||||
"F": (IMG_WIDTH - 48 - COORDS_L['F'][0], COORDS_L['F'][1]),
|
"F": (IMG_WIDTH - 43 - COORDS_L['F'][0], COORDS_L['F'][1]),
|
||||||
"U": (IMG_WIDTH - 48 - COORDS_L['U'][0], COORDS_L['U'][1]),
|
"U": (IMG_WIDTH - 43 - COORDS_L['U'][0], COORDS_L['U'][1]),
|
||||||
}
|
}
|
||||||
|
|
||||||
STATES = ["BOTH"]
|
FULL_COORDS = {key: (COORDS_L[key], COORDS_R[key]) for key in COORDS_L}
|
||||||
|
|
||||||
|
|
||||||
|
print(FULL_COORDS)
|
||||||
overlay = Image.open(input_wound_texture)
|
overlay = Image.open(input_wound_texture)
|
||||||
|
|
||||||
for filepath in input_bodies_path.glob('*.png'): # Only PNG files
|
for filepath in input_bodies_path.glob('*.png'): # Only PNG files
|
||||||
|
print(f'Processing {filepath.name}...')
|
||||||
base = Image.open(filepath)
|
base = Image.open(filepath)
|
||||||
body_name = filepath.stem
|
|
||||||
|
|
||||||
|
|
||||||
for key_L, value_L in COORDS_L.items():
|
body_name = filepath.stem.replace('MaleBody', 'skin')
|
||||||
for key_R, value_R in COORDS_R.items():
|
if body_name.endswith('a'):
|
||||||
for state in STATES:
|
body_name = body_name[:-1] + '_hairy_b'
|
||||||
|
else:
|
||||||
|
body_name = body_name + '_b'
|
||||||
|
|
||||||
|
for key, (value_L, value_R) in FULL_COORDS.items():
|
||||||
|
print(key)
|
||||||
result = base.copy()
|
result = base.copy()
|
||||||
|
|
||||||
if state == "BOTH" or state == "ONLY_LEFT":
|
|
||||||
result.paste(overlay, value_L, mask=overlay)
|
result.paste(overlay, value_L, mask=overlay)
|
||||||
if state == "BOTH" or state == "ONLY_RIGHT":
|
|
||||||
result.paste(overlay, value_R, mask=overlay)
|
result.paste(overlay, value_R, mask=overlay)
|
||||||
|
|
||||||
result.save(f'output/{body_name}_{key_L}_{key_R}_{state}.png')
|
output_path = 'output/'
|
||||||
|
|
||||||
|
if key == "H":
|
||||||
|
os.makedirs('output/Hand', exist_ok=True)
|
||||||
|
output_path = 'output/Hand'
|
||||||
|
|
||||||
|
if key == "F":
|
||||||
|
os.makedirs('output/Forearm', exist_ok=True)
|
||||||
|
output_path = 'output/Forearm'
|
||||||
|
|
||||||
|
if key == "U":
|
||||||
|
os.makedirs('output/UpperArm', exist_ok=True)
|
||||||
|
output_path = 'output/UpperArm'
|
||||||
|
|
||||||
|
result.save(f'{output_path}/{body_name}.png')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||