1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Minor fixes to mergers / splitters

This commit is contained in:
tobspr
2020-07-06 21:53:03 +02:00
parent 04ea105584
commit feb10c3805
21 changed files with 305 additions and 291 deletions

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

View File

@@ -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))))