Minor fixes to mergers / splitters

pull/446/head
tobspr 4 years ago
parent 04ea105584
commit feb10c3805

@ -914,10 +914,10 @@
},
"sprites/blueprints/wire_top.png":
{
"frame": {"x":680,"y":3,"w":5,"h":13},
"frame": {"x":680,"y":3,"w":6,"h":13},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":4,"y":0,"w":5,"h":13},
"spriteSourceSize": {"x":4,"y":0,"w":6,"h":13},
"sourceSize": {"w":13,"h":13}
},
"sprites/buildings/advanced_processor.png":
@ -1383,6 +1383,6 @@
"format": "RGBA8888",
"size": {"w":690,"h":127},
"scale": "0.1",
"smartupdate": "$TexturePacker:SmartUpdate:812e8a2b8b0a4c9bbeb20fc68d835efe:85394009739c7a89da6c54b97c627497:f159918d23e5952766c6d23ab52278c6$"
"smartupdate": "$TexturePacker:SmartUpdate:0b0b30763ad223eaf27d38779febe72e:d99996306029a5a7291a271635ca5e37:f159918d23e5952766c6d23ab52278c6$"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 70 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

@ -1383,6 +1383,6 @@
"format": "RGBA8888",
"size": {"w":841,"h":481},
"scale": "0.25",
"smartupdate": "$TexturePacker:SmartUpdate:812e8a2b8b0a4c9bbeb20fc68d835efe:85394009739c7a89da6c54b97c627497:f159918d23e5952766c6d23ab52278c6$"
"smartupdate": "$TexturePacker:SmartUpdate:0b0b30763ad223eaf27d38779febe72e:d99996306029a5a7291a271635ca5e37:f159918d23e5952766c6d23ab52278c6$"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 217 KiB

After

Width:  |  Height:  |  Size: 217 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 522 KiB

After

Width:  |  Height:  |  Size: 522 KiB

@ -898,7 +898,7 @@
},
"sprites/blueprints/wire_left.png":
{
"frame": {"x":1706,"y":1596,"w":60,"h":60},
"frame": {"x":1705,"y":1596,"w":60,"h":60},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":35,"w":60,"h":60},
@ -906,18 +906,18 @@
},
"sprites/blueprints/wire_right.png":
{
"frame": {"x":1641,"y":1596,"w":61,"h":61},
"frame": {"x":1641,"y":1596,"w":60,"h":61},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":34,"y":34,"w":61,"h":61},
"spriteSourceSize": {"x":35,"y":34,"w":60,"h":61},
"sourceSize": {"w":95,"h":95}
},
"sprites/blueprints/wire_top.png":
{
"frame": {"x":1809,"y":298,"w":27,"h":95},
"frame": {"x":1809,"y":298,"w":25,"h":95},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":34,"y":0,"w":27,"h":95},
"spriteSourceSize": {"x":35,"y":0,"w":25,"h":95},
"sourceSize": {"w":95,"h":95}
},
"sprites/buildings/advanced_processor.png":
@ -1154,7 +1154,7 @@
},
"sprites/buildings/wire_left.png":
{
"frame": {"x":1770,"y":1596,"w":60,"h":60},
"frame": {"x":1769,"y":1596,"w":60,"h":60},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":35,"w":60,"h":60},
@ -1194,7 +1194,7 @@
},
"sprites/map_overview/belt_forward.png":
{
"frame": {"x":1840,"y":298,"w":20,"h":24},
"frame": {"x":1465,"y":1663,"w":20,"h":24},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":2,"y":0,"w":20,"h":24},
@ -1202,7 +1202,7 @@
},
"sprites/map_overview/belt_left.png":
{
"frame": {"x":1617,"y":786,"w":22,"h":22},
"frame": {"x":1838,"y":298,"w":22,"h":22},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":0,"y":2,"w":22,"h":22},
@ -1210,7 +1210,7 @@
},
"sprites/map_overview/belt_right.png":
{
"frame": {"x":1079,"y":1133,"w":22,"h":22},
"frame": {"x":1838,"y":324,"w":22,"h":22},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":2,"y":2,"w":22,"h":22},
@ -1274,7 +1274,7 @@
},
"sprites/misc/waypoint.png":
{
"frame": {"x":1840,"y":326,"w":20,"h":24},
"frame": {"x":1489,"y":1663,"w":20,"h":24},
"rotated": false,
"trimmed": true,
"spriteSourceSize": {"x":2,"y":0,"w":20,"h":24},
@ -1383,6 +1383,6 @@
"format": "RGBA8888",
"size": {"w":1863,"h":1690},
"scale": "0.75",
"smartupdate": "$TexturePacker:SmartUpdate:812e8a2b8b0a4c9bbeb20fc68d835efe:85394009739c7a89da6c54b97c627497:f159918d23e5952766c6d23ab52278c6$"
"smartupdate": "$TexturePacker:SmartUpdate:0b0b30763ad223eaf27d38779febe72e:d99996306029a5a7291a271635ca5e37:f159918d23e5952766c6d23ab52278c6$"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 941 B

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

@ -21,6 +21,8 @@ def rgb2gray(rgb):
return np.dot(rgb[..., :3], [0.2989, 0.5870, 0.1140])
def save_image(data, outfilename, src_image):
img = Image.fromarray(np.asarray(
np.clip(data, 0, 255), dtype="uint8"), "L")
@ -32,6 +34,18 @@ def save_image(data, outfilename, src_image):
mask = src_image.filter(ImageFilter.GaussianBlur(10)).load()
orig = src_image.load()
isWire = "wire" in outfilename
targetR = 104
targetG = 200
targetB = 255
if isWire:
targetR = 255
targetG = 104
targetB = 232
for x in range(img.width):
for y in range(img.height):
realpixl = realSrc[x, y]
@ -49,9 +63,9 @@ def save_image(data, outfilename, src_image):
noShadow = 1 - shadow
dst[x, y] = (
min(255, int((realpixl[0] / 255.0 * 0.4 + 0.6) * 104 * 1.1)),
min(255, int((realpixl[1] / 255.0 * 0.4 + 0.6) * 200 * 1.1)),
min(255, int((realpixl[2] / 255.0 * 0.4 + 0.6) * 255 * 1.1)),
min(255, int((realpixl[0] / 255.0 * 0.4 + 0.6) * targetR * 1.1)),
min(255, int((realpixl[1] / 255.0 * 0.4 + 0.6) * targetG * 1.1)),
min(255, int((realpixl[2] / 255.0 * 0.4 + 0.6) * targetB * 1.1)),
min(255, int(float(realpixl[3]) * (0.6 + 5 * edgeFactor))))

@ -56,10 +56,10 @@ export const KEYMAPPINGS = {
trash: { keyCode: key("0") },
energy_generator: { keyCode: key("O") },
advanced_processor: { keyCode: key("P") },
wire_crossings: { keyCode: key("H") },
// Wires layer
wire: { keyCode: key("1") },
wire_crossings: { keyCode: key("2") },
},
placement: {

Loading…
Cancel
Save