Merge remote-tracking branch 'origin/lephe-art' into dev

This commit is contained in:
SlyVTT 2023-08-20 10:52:03 +02:00
commit 311ee090b0
11 changed files with 30 additions and 34 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6 KiB

After

Width:  |  Height:  |  Size: 7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 650 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 683 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 B

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -1,41 +1,15 @@
demo_player.png: *.png:
type: bopti-image custom-type: custom-image
name: demo_player_img name_regex: (.*)\.png \1_img
profile: p8 profile: p8
scale: 2
demo_PNJ.png: demo_PNG.png:
type: bopti-image scale: 1
name: demo_PNJ_img
profile: p8
player_face.png:
type: bopti-image
name: player_face_img
profile: p8
SignAction.png:
type: bopti-image
name: SignAction_img
profile: p8
INFO_Icon.png:
type: bopti-image
name: INFO_Icon_img
profile: p8
NPC_Icon.png:
type: bopti-image
name: NPC_Icon_img
profile: p8
SGN_Icon.png:
type: bopti-image
name: SGN_Icon_img
profile: p8
font.png: font.png:
name: fontRPG name: fontRPG
type: font custom-type: font
charset: print charset: print
grid.size: 10x10 grid.size: 10x10
grid.padding: 2 grid.padding: 2

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

@ -1,4 +1,5 @@
from random import randint from random import randint
from PIL import Image
import fxconv import fxconv
import json import json
import pathlib import pathlib
@ -12,6 +13,12 @@ def convert(input, output, params, target):
elif params["custom-type"] == "world": elif params["custom-type"] == "world":
convert_world(input, output, params, target) convert_world(input, output, params, target)
return 0 return 0
elif params["custom-type"] == "custom-image":
convert_custom_image(input, output, params, target)
return 0
elif params["custom-type"] == "font":
convert_font(input, output, params, target)
return 0
else: else:
return 1 return 1
@ -339,3 +346,18 @@ def get_extra_map_data(input, output, params, target, xmin, ymin, xmax, ymax):
break break
return nbExtraData, structData return nbExtraData, structData
def convert_custom_image(input, output, params, target):
scale = int(params.get("scale", 1))
# Upscale image before converting
im = Image.open(input)
im = im.resize((im.width * scale, im.height * scale),
resample=Image.NEAREST)
o = fxconv.convert_image_cg(im, params)
fxconv.elf(o, output, "_" + params["name"], **target)
def convert_font(input, output, params, target):
o = fxconv.convert_topti(input, params)
fxconv.elf(o, output, "_" + params["name"], **target)