many text work and scripts
BIN
UnRLE/0397_LASTEVENT/0366_016_1_0_U
Normal file
BIN
UnRLE/0397_LASTEVENT/0366_016_1_0_U.p2e
Normal file
BIN
UnRLE/0397_LASTEVENT/0397.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
UnRLE/0397_LASTEVENT/0397_00_00_00.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
UnRLE/0397_LASTEVENT/0397_017_0_0_U
Normal file
BIN
UnRLE/0397_LASTEVENT/0397_018_0_0_U
Normal file
0
UnRLE/0397_LASTEVENT/0397_019_0_0_U
Normal file
BIN
UnRLE/0397_LASTEVENT/0397_019_0_0_U.p2coll
Normal file
BIN
UnRLE/0397_LASTEVENT/0397_01_00_00.png
Normal file
|
After Width: | Height: | Size: 180 B |
BIN
UnRLE/0397_LASTEVENT/0397_020_0_0_U
Normal file
1
UnRLE/0397_LASTEVENT/0397_021_0_0_U
Normal file
@@ -0,0 +1 @@
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
BIN
UnRLE/0397_LASTEVENT/0397_024_0_0_U
Normal file
BIN
UnRLE/0397_LASTEVENT/0397_02_00_00.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
UnRLE/0397_LASTEVENT/0397_03_00_00.png
Normal file
|
After Width: | Height: | Size: 167 B |
BIN
UnRLE/0397_LASTEVENT/0397_04_00_00.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
UnRLE/0397_LASTEVENT/0397_05_00_00.png
Normal file
|
After Width: | Height: | Size: 148 B |
BIN
UnRLE/0397_LASTEVENT/0397_06_00_00.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
UnRLE/0397_LASTEVENT/0397_07_00_00.png
Normal file
|
After Width: | Height: | Size: 183 B |
BIN
UnRLE/0397_LASTEVENT/0397_08_00_00.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
UnRLE/0397_LASTEVENT/0397_09_00_00.png
Normal file
|
After Width: | Height: | Size: 170 B |
BIN
UnRLE/0397_LASTEVENT/0397_10_00_00.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
UnRLE/0397_LASTEVENT/0397_11_00_00.png
Normal file
|
After Width: | Height: | Size: 152 B |
BIN
UnRLE/0397_LASTEVENT/0397_12_00_00.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
UnRLE/0397_LASTEVENT/0397_13_00_00.png
Normal file
|
After Width: | Height: | Size: 183 B |
BIN
UnRLE/0397_LASTEVENT/0397_14_00_00.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
UnRLE/0397_LASTEVENT/0397_15_00_00.png
Normal file
|
After Width: | Height: | Size: 152 B |
BIN
UnRLE/0397_LASTEVENT/0397_16_0_0_CUST.p2e
Normal file
BIN
UnRLE/0397_LASTEVENT/0397_RAW_BACKUP.bin
Normal file
BIN
UnRLE/0397_LASTEVENT/0397_RAW_TEST_TEXTURES.bin
Normal file
75
UnRLE/0397_LASTEVENT/split.py
Normal file
@@ -0,0 +1,75 @@
|
||||
from PIL import Image
|
||||
import sys
|
||||
import os
|
||||
|
||||
def split_and_convert(img_path, tile_size=(64, 256)):
|
||||
# Открываем изображение
|
||||
img = Image.open(img_path)
|
||||
width, height = img.size
|
||||
|
||||
# Получаем имя файла без расширения
|
||||
base_name = os.path.splitext(os.path.basename(img_path))[0]
|
||||
|
||||
counter = 0
|
||||
|
||||
for i in range(0, width, tile_size[0]):
|
||||
for j in range(0, height, tile_size[1]):
|
||||
box = (i, j, i+tile_size[0], j+tile_size[1])
|
||||
tile = img.crop(box)
|
||||
|
||||
# Конвертируем в 256 цветов
|
||||
tile = tile.convert('P', palette=Image.Palette.ADAPTIVE, colors=256)
|
||||
|
||||
# Сохраняем тайл с чётным индексом
|
||||
tile.save(f'{base_name}_{counter:02d}_00_00.png', optimize=True)
|
||||
|
||||
# Извлекаем палитру
|
||||
palette = tile.getpalette()
|
||||
if palette:
|
||||
# Создаём изображение палитры 256x1
|
||||
# Каждый пиксель - один цвет из палитры
|
||||
palette_rgb = []
|
||||
for k in range(0, len(palette), 3):
|
||||
r, g, b = palette[k], palette[k+1], palette[k+2]
|
||||
palette_rgb.append((r, g, b))
|
||||
|
||||
# Обрезаем до 256 цветов (на всякий случай)
|
||||
palette_rgb = palette_rgb[:256]
|
||||
|
||||
# Создаём изображение палитры 256x10 (можно сделать 256x1, но так нагляднее)
|
||||
palette_img = Image.new('RGB', (256, 1))
|
||||
|
||||
# Заполняем каждый столбец своим цветом
|
||||
for x in range(256):
|
||||
color = palette_rgb[x] if x < len(palette_rgb) else (0, 0, 0)
|
||||
for y in range(1):
|
||||
palette_img.putpixel((x, y), color)
|
||||
|
||||
# Сохраняем палитру с нечётным индексом как 16-bit PNG
|
||||
palette_img.save(
|
||||
f'{base_name}_{counter+1:02d}_00_00.png',
|
||||
optimize=True,
|
||||
bits=16 # 16-битное сохранение
|
||||
)
|
||||
|
||||
counter += 2
|
||||
|
||||
def main():
|
||||
# Проверяем аргументы командной строки
|
||||
if len(sys.argv) < 2:
|
||||
print("Использование: python script.py <input_image>")
|
||||
print("Пример: python script.py TEST.png")
|
||||
sys.exit(1)
|
||||
|
||||
input_image = sys.argv[1]
|
||||
|
||||
# Проверяем существование файла
|
||||
if not os.path.exists(input_image):
|
||||
print(f"Ошибка: Файл '{input_image}' не найден")
|
||||
sys.exit(1)
|
||||
|
||||
# Запускаем обработку
|
||||
split_and_convert(input_image)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||