split textures even smaller (2048x2048)
This commit is contained in:
parent
2d37104f71
commit
913eb466d3
|
|
@ -470,7 +470,7 @@
|
||||||
"columns":18,
|
"columns":18,
|
||||||
"firstgid":321,
|
"firstgid":321,
|
||||||
"image":"imgs\/cija_32x32_expansion for Pipoya_CC0_0000.png",
|
"image":"imgs\/cija_32x32_expansion for Pipoya_CC0_0000.png",
|
||||||
"imageheight":4096,
|
"imageheight":2048,
|
||||||
"imagewidth":576,
|
"imagewidth":576,
|
||||||
"margin":0,
|
"margin":0,
|
||||||
"name":"cija_32x32_expansion for Pipoya_CC0 (0, 0)",
|
"name":"cija_32x32_expansion for Pipoya_CC0 (0, 0)",
|
||||||
|
|
@ -481,18 +481,37 @@
|
||||||
"value":"CC0"
|
"value":"CC0"
|
||||||
}],
|
}],
|
||||||
"spacing":0,
|
"spacing":0,
|
||||||
"tilecount":2304,
|
"tilecount":1152,
|
||||||
|
"tileheight":32,
|
||||||
|
"tilewidth":32
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"columns":18,
|
||||||
|
"firstgid":1473,
|
||||||
|
"image":"imgs\/cija_32x32_expansion for Pipoya_CC0_0001.png",
|
||||||
|
"imageheight":2048,
|
||||||
|
"imagewidth":576,
|
||||||
|
"margin":0,
|
||||||
|
"name":"cija_32x32_expansion for Pipoya_CC0 (0, 1)",
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"tilesetCopyright",
|
||||||
|
"type":"string",
|
||||||
|
"value":"CC0"
|
||||||
|
}],
|
||||||
|
"spacing":0,
|
||||||
|
"tilecount":1152,
|
||||||
"tileheight":32,
|
"tileheight":32,
|
||||||
"tilewidth":32
|
"tilewidth":32
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"columns":18,
|
"columns":18,
|
||||||
"firstgid":2625,
|
"firstgid":2625,
|
||||||
"image":"imgs\/cija_32x32_expansion for Pipoya_CC0_0001.png",
|
"image":"imgs\/cija_32x32_expansion for Pipoya_CC0_0002.png",
|
||||||
"imageheight":160,
|
"imageheight":160,
|
||||||
"imagewidth":576,
|
"imagewidth":576,
|
||||||
"margin":0,
|
"margin":0,
|
||||||
"name":"cija_32x32_expansion for Pipoya_CC0 (0, 1)",
|
"name":"cija_32x32_expansion for Pipoya_CC0 (0, 2)",
|
||||||
"properties":[
|
"properties":[
|
||||||
{
|
{
|
||||||
"name":"tilesetCopyright",
|
"name":"tilesetCopyright",
|
||||||
|
|
|
||||||
|
|
@ -456,7 +456,7 @@
|
||||||
"columns":18,
|
"columns":18,
|
||||||
"firstgid":321,
|
"firstgid":321,
|
||||||
"image":"imgs\/cija_32x32_expansion for Pipoya_CC0_0000.png",
|
"image":"imgs\/cija_32x32_expansion for Pipoya_CC0_0000.png",
|
||||||
"imageheight":4096,
|
"imageheight":2048,
|
||||||
"imagewidth":576,
|
"imagewidth":576,
|
||||||
"margin":0,
|
"margin":0,
|
||||||
"name":"cija_32x32_expansion for Pipoya_CC0 (0, 0)",
|
"name":"cija_32x32_expansion for Pipoya_CC0 (0, 0)",
|
||||||
|
|
@ -467,18 +467,37 @@
|
||||||
"value":"CC0"
|
"value":"CC0"
|
||||||
}],
|
}],
|
||||||
"spacing":0,
|
"spacing":0,
|
||||||
"tilecount":2304,
|
"tilecount":1152,
|
||||||
|
"tileheight":32,
|
||||||
|
"tilewidth":32
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"columns":18,
|
||||||
|
"firstgid":1473,
|
||||||
|
"image":"imgs\/cija_32x32_expansion for Pipoya_CC0_0001.png",
|
||||||
|
"imageheight":2048,
|
||||||
|
"imagewidth":576,
|
||||||
|
"margin":0,
|
||||||
|
"name":"cija_32x32_expansion for Pipoya_CC0 (0, 1)",
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"tilesetCopyright",
|
||||||
|
"type":"string",
|
||||||
|
"value":"CC0"
|
||||||
|
}],
|
||||||
|
"spacing":0,
|
||||||
|
"tilecount":1152,
|
||||||
"tileheight":32,
|
"tileheight":32,
|
||||||
"tilewidth":32
|
"tilewidth":32
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"columns":18,
|
"columns":18,
|
||||||
"firstgid":2625,
|
"firstgid":2625,
|
||||||
"image":"imgs\/cija_32x32_expansion for Pipoya_CC0_0001.png",
|
"image":"imgs\/cija_32x32_expansion for Pipoya_CC0_0002.png",
|
||||||
"imageheight":160,
|
"imageheight":160,
|
||||||
"imagewidth":576,
|
"imagewidth":576,
|
||||||
"margin":0,
|
"margin":0,
|
||||||
"name":"cija_32x32_expansion for Pipoya_CC0 (0, 1)",
|
"name":"cija_32x32_expansion for Pipoya_CC0 (0, 2)",
|
||||||
"properties":[
|
"properties":[
|
||||||
{
|
{
|
||||||
"name":"tilesetCopyright",
|
"name":"tilesetCopyright",
|
||||||
|
|
|
||||||
|
|
@ -18,17 +18,23 @@
|
||||||
</properties>
|
</properties>
|
||||||
<image source="imgs/tilesets_deviant_milkian_1.png" width="512" height="512"/>
|
<image source="imgs/tilesets_deviant_milkian_1.png" width="512" height="512"/>
|
||||||
</tileset>
|
</tileset>
|
||||||
<tileset firstgid="321" name="cija_32x32_expansion for Pipoya_CC0 (0, 0)" tilewidth="32" tileheight="32" tilecount="2304" columns="18">
|
<tileset firstgid="321" name="cija_32x32_expansion for Pipoya_CC0 (0, 0)" tilewidth="32" tileheight="32" tilecount="1152" columns="18">
|
||||||
<properties>
|
<properties>
|
||||||
<property name="tilesetCopyright" value="CC0"/>
|
<property name="tilesetCopyright" value="CC0"/>
|
||||||
</properties>
|
</properties>
|
||||||
<image source="imgs/cija_32x32_expansion for Pipoya_CC0_0000.png" width="576" height="4096"/>
|
<image source="imgs/cija_32x32_expansion for Pipoya_CC0_0000.png" width="576" height="2048"/>
|
||||||
</tileset>
|
</tileset>
|
||||||
<tileset firstgid="2625" name="cija_32x32_expansion for Pipoya_CC0 (0, 1)" tilewidth="32" tileheight="32" tilecount="90" columns="18">
|
<tileset firstgid="1473" name="cija_32x32_expansion for Pipoya_CC0 (0, 1)" tilewidth="32" tileheight="32" tilecount="1152" columns="18">
|
||||||
<properties>
|
<properties>
|
||||||
<property name="tilesetCopyright" value="CC0"/>
|
<property name="tilesetCopyright" value="CC0"/>
|
||||||
</properties>
|
</properties>
|
||||||
<image source="imgs/cija_32x32_expansion for Pipoya_CC0_0001.png" width="576" height="160"/>
|
<image source="imgs/cija_32x32_expansion for Pipoya_CC0_0001.png" width="576" height="2048"/>
|
||||||
|
</tileset>
|
||||||
|
<tileset firstgid="2625" name="cija_32x32_expansion for Pipoya_CC0 (0, 2)" tilewidth="32" tileheight="32" tilecount="90" columns="18">
|
||||||
|
<properties>
|
||||||
|
<property name="tilesetCopyright" value="CC0"/>
|
||||||
|
</properties>
|
||||||
|
<image source="imgs/cija_32x32_expansion for Pipoya_CC0_0002.png" width="576" height="160"/>
|
||||||
</tileset>
|
</tileset>
|
||||||
<tileset firstgid="2715" name="01_door" tilewidth="32" tileheight="32" tilecount="8" columns="4">
|
<tileset firstgid="2715" name="01_door" tilewidth="32" tileheight="32" tilecount="8" columns="4">
|
||||||
<properties>
|
<properties>
|
||||||
|
|
|
||||||
|
|
@ -18,17 +18,23 @@
|
||||||
</properties>
|
</properties>
|
||||||
<image source="imgs/tilesets_deviant_milkian_1.png" width="512" height="512"/>
|
<image source="imgs/tilesets_deviant_milkian_1.png" width="512" height="512"/>
|
||||||
</tileset>
|
</tileset>
|
||||||
<tileset firstgid="321" name="cija_32x32_expansion for Pipoya_CC0 (0, 0)" tilewidth="32" tileheight="32" tilecount="2304" columns="18">
|
<tileset firstgid="321" name="cija_32x32_expansion for Pipoya_CC0 (0, 0)" tilewidth="32" tileheight="32" tilecount="1152" columns="18">
|
||||||
<properties>
|
<properties>
|
||||||
<property name="tilesetCopyright" value="CC0"/>
|
<property name="tilesetCopyright" value="CC0"/>
|
||||||
</properties>
|
</properties>
|
||||||
<image source="imgs/cija_32x32_expansion for Pipoya_CC0_0000.png" width="576" height="4096"/>
|
<image source="imgs/cija_32x32_expansion for Pipoya_CC0_0000.png" width="576" height="2048"/>
|
||||||
</tileset>
|
</tileset>
|
||||||
<tileset firstgid="2625" name="cija_32x32_expansion for Pipoya_CC0 (0, 1)" tilewidth="32" tileheight="32" tilecount="90" columns="18">
|
<tileset firstgid="1473" name="cija_32x32_expansion for Pipoya_CC0 (0, 1)" tilewidth="32" tileheight="32" tilecount="1152" columns="18">
|
||||||
<properties>
|
<properties>
|
||||||
<property name="tilesetCopyright" value="CC0"/>
|
<property name="tilesetCopyright" value="CC0"/>
|
||||||
</properties>
|
</properties>
|
||||||
<image source="imgs/cija_32x32_expansion for Pipoya_CC0_0001.png" width="576" height="160"/>
|
<image source="imgs/cija_32x32_expansion for Pipoya_CC0_0001.png" width="576" height="2048"/>
|
||||||
|
</tileset>
|
||||||
|
<tileset firstgid="2625" name="cija_32x32_expansion for Pipoya_CC0 (0, 2)" tilewidth="32" tileheight="32" tilecount="90" columns="18">
|
||||||
|
<properties>
|
||||||
|
<property name="tilesetCopyright" value="CC0"/>
|
||||||
|
</properties>
|
||||||
|
<image source="imgs/cija_32x32_expansion for Pipoya_CC0_0002.png" width="576" height="160"/>
|
||||||
</tileset>
|
</tileset>
|
||||||
<tileset firstgid="2715" name="01_door" tilewidth="32" tileheight="32" tilecount="8" columns="4">
|
<tileset firstgid="2715" name="01_door" tilewidth="32" tileheight="32" tilecount="8" columns="4">
|
||||||
<properties>
|
<properties>
|
||||||
|
|
|
||||||
14
heizhaus.tmx
14
heizhaus.tmx
|
|
@ -18,17 +18,23 @@
|
||||||
</properties>
|
</properties>
|
||||||
<image source="imgs/tilesets_deviant_milkian_1.png" width="512" height="512"/>
|
<image source="imgs/tilesets_deviant_milkian_1.png" width="512" height="512"/>
|
||||||
</tileset>
|
</tileset>
|
||||||
<tileset firstgid="321" name="cija_32x32_expansion for Pipoya_CC0 (0, 0)" tilewidth="32" tileheight="32" tilecount="2304" columns="18">
|
<tileset firstgid="321" name="cija_32x32_expansion for Pipoya_CC0 (0, 0)" tilewidth="32" tileheight="32" tilecount="1152" columns="18">
|
||||||
<properties>
|
<properties>
|
||||||
<property name="tilesetCopyright" value="CC0"/>
|
<property name="tilesetCopyright" value="CC0"/>
|
||||||
</properties>
|
</properties>
|
||||||
<image source="imgs/cija_32x32_expansion for Pipoya_CC0_0000.png" width="576" height="4096"/>
|
<image source="imgs/cija_32x32_expansion for Pipoya_CC0_0000.png" width="576" height="2048"/>
|
||||||
</tileset>
|
</tileset>
|
||||||
<tileset firstgid="2625" name="cija_32x32_expansion for Pipoya_CC0 (0, 1)" tilewidth="32" tileheight="32" tilecount="90" columns="18">
|
<tileset firstgid="1473" name="cija_32x32_expansion for Pipoya_CC0 (0, 1)" tilewidth="32" tileheight="32" tilecount="1152" columns="18">
|
||||||
<properties>
|
<properties>
|
||||||
<property name="tilesetCopyright" value="CC0"/>
|
<property name="tilesetCopyright" value="CC0"/>
|
||||||
</properties>
|
</properties>
|
||||||
<image source="imgs/cija_32x32_expansion for Pipoya_CC0_0001.png" width="576" height="160"/>
|
<image source="imgs/cija_32x32_expansion for Pipoya_CC0_0001.png" width="576" height="2048"/>
|
||||||
|
</tileset>
|
||||||
|
<tileset firstgid="2625" name="cija_32x32_expansion for Pipoya_CC0 (0, 2)" tilewidth="32" tileheight="32" tilecount="90" columns="18">
|
||||||
|
<properties>
|
||||||
|
<property name="tilesetCopyright" value="CC0"/>
|
||||||
|
</properties>
|
||||||
|
<image source="imgs/cija_32x32_expansion for Pipoya_CC0_0002.png" width="576" height="160"/>
|
||||||
</tileset>
|
</tileset>
|
||||||
<tileset firstgid="2715" name="01_door" tilewidth="32" tileheight="32" tilecount="8" columns="4">
|
<tileset firstgid="2715" name="01_door" tilewidth="32" tileheight="32" tilecount="8" columns="4">
|
||||||
<properties>
|
<properties>
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 588 KiB After Width: | Height: | Size: 369 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 219 KiB |
BIN
imgs/cija_32x32_expansion for Pipoya_CC0_0002.png
Normal file
BIN
imgs/cija_32x32_expansion for Pipoya_CC0_0002.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
27
main.json
27
main.json
|
|
@ -803,7 +803,7 @@
|
||||||
"columns":18,
|
"columns":18,
|
||||||
"firstgid":321,
|
"firstgid":321,
|
||||||
"image":"imgs\/cija_32x32_expansion for Pipoya_CC0_0000.png",
|
"image":"imgs\/cija_32x32_expansion for Pipoya_CC0_0000.png",
|
||||||
"imageheight":4096,
|
"imageheight":2048,
|
||||||
"imagewidth":576,
|
"imagewidth":576,
|
||||||
"margin":0,
|
"margin":0,
|
||||||
"name":"cija_32x32_expansion for Pipoya_CC0 (0, 0)",
|
"name":"cija_32x32_expansion for Pipoya_CC0 (0, 0)",
|
||||||
|
|
@ -814,18 +814,37 @@
|
||||||
"value":"CC0"
|
"value":"CC0"
|
||||||
}],
|
}],
|
||||||
"spacing":0,
|
"spacing":0,
|
||||||
"tilecount":2304,
|
"tilecount":1152,
|
||||||
|
"tileheight":32,
|
||||||
|
"tilewidth":32
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"columns":18,
|
||||||
|
"firstgid":1473,
|
||||||
|
"image":"imgs\/cija_32x32_expansion for Pipoya_CC0_0001.png",
|
||||||
|
"imageheight":2048,
|
||||||
|
"imagewidth":576,
|
||||||
|
"margin":0,
|
||||||
|
"name":"cija_32x32_expansion for Pipoya_CC0 (0, 1)",
|
||||||
|
"properties":[
|
||||||
|
{
|
||||||
|
"name":"tilesetCopyright",
|
||||||
|
"type":"string",
|
||||||
|
"value":"CC0"
|
||||||
|
}],
|
||||||
|
"spacing":0,
|
||||||
|
"tilecount":1152,
|
||||||
"tileheight":32,
|
"tileheight":32,
|
||||||
"tilewidth":32
|
"tilewidth":32
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"columns":18,
|
"columns":18,
|
||||||
"firstgid":2625,
|
"firstgid":2625,
|
||||||
"image":"imgs\/cija_32x32_expansion for Pipoya_CC0_0001.png",
|
"image":"imgs\/cija_32x32_expansion for Pipoya_CC0_0002.png",
|
||||||
"imageheight":160,
|
"imageheight":160,
|
||||||
"imagewidth":576,
|
"imagewidth":576,
|
||||||
"margin":0,
|
"margin":0,
|
||||||
"name":"cija_32x32_expansion for Pipoya_CC0 (0, 1)",
|
"name":"cija_32x32_expansion for Pipoya_CC0 (0, 2)",
|
||||||
"properties":[
|
"properties":[
|
||||||
{
|
{
|
||||||
"name":"tilesetCopyright",
|
"name":"tilesetCopyright",
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ def main():
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--split-tilesets",
|
"--split-tilesets",
|
||||||
help="split tilesets bigger than 4096x4096",
|
help="split tilesets bigger than 2048x2048",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
)
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
@ -167,10 +167,10 @@ def separate_collisions(map):
|
||||||
def split_tilesets(map):
|
def split_tilesets(map):
|
||||||
for tileset in map.findall("tileset"):
|
for tileset in map.findall("tileset"):
|
||||||
image = tileset.find("image")
|
image = tileset.find("image")
|
||||||
if int(image.attrib["width"]) <= 4096 and int(image.attrib["height"]) <= 4096:
|
if int(image.attrib["width"]) <= 2048 and int(image.attrib["height"]) <= 2048:
|
||||||
continue
|
continue
|
||||||
if int(image.attrib["width"]) > 4096:
|
if int(image.attrib["width"]) > 2048:
|
||||||
print("Can't split tileset '%s'. Spliting of width > 4096 not implemented." % tileset.attrib["name"])
|
print("Can't split tileset '%s'. Spliting of width > 2048 not implemented." % tileset.attrib["name"])
|
||||||
continue
|
continue
|
||||||
dosplit = input("Split tileset '%s'? [yN] " % tileset.attrib["name"])
|
dosplit = input("Split tileset '%s'? [yN] " % tileset.attrib["name"])
|
||||||
if dosplit.lower() != "y":
|
if dosplit.lower() != "y":
|
||||||
|
|
@ -181,16 +181,16 @@ def split_tilesets(map):
|
||||||
tileheight = int(tileset.attrib["tileheight"])
|
tileheight = int(tileset.attrib["tileheight"])
|
||||||
image_source = Path(image.attrib["source"])
|
image_source = Path(image.attrib["source"])
|
||||||
with Image.open(image_source) as im:
|
with Image.open(image_source) as im:
|
||||||
for i, x in enumerate(range(0, im.width, 4096)):
|
for i, x in enumerate(range(0, im.width, 2048)):
|
||||||
for j, y in enumerate(range(0, im.height, 4096)):
|
for j, y in enumerate(range(0, im.height, 2048)):
|
||||||
croped_source = image_source.with_stem(
|
croped_source = image_source.with_stem(
|
||||||
"%s_%02d%02d" % (image_source.stem, i, j)
|
"%s_%02d%02d" % (image_source.stem, i, j)
|
||||||
)
|
)
|
||||||
im.crop(
|
im.crop(
|
||||||
(x, y, min(x + 4096, im.width), min(y + 4096, im.height))
|
(x, y, min(x + 2048, im.width), min(y + 2048, im.height))
|
||||||
).save(croped_source)
|
).save(croped_source)
|
||||||
width = min(4096, im.width - x)
|
width = min(2048, im.width - x)
|
||||||
height = min(4096, im.height - y)
|
height = min(2048, im.height - y)
|
||||||
columns = width // tilewidth
|
columns = width // tilewidth
|
||||||
tilecount = columns * (height // tileheight)
|
tilecount = columns * (height // tileheight)
|
||||||
tileset_croped = etree.Element(
|
tileset_croped = etree.Element(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue