EntropyDrop commited on
Commit
5bbe62a
·
1 Parent(s): da271e5
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitignore +2 -0
  2. alice_to_steve.py +18 -0
  3. build_target_img.py +300 -0
  4. build_target_imgs.py +40 -0
  5. control_imgs/.DS_Store +0 -0
  6. control_imgs/0042.png +3 -0
  7. control_imgs/12.png +3 -0
  8. control_imgs/17474.png +3 -0
  9. control_imgs/1ed2b9af-0722-4869-8685-294610976cb5.png +3 -0
  10. control_imgs/222855.png +3 -0
  11. control_imgs/408097.png +3 -0
  12. control_imgs/49ed3dbc-2d35-491c-b995-be54c59ab423.png +3 -0
  13. control_imgs/517485.png +3 -0
  14. control_imgs/519494.png +3 -0
  15. control_imgs/525273.png +3 -0
  16. control_imgs/538419.png +3 -0
  17. control_imgs/553045.png +3 -0
  18. control_imgs/560261.png +3 -0
  19. control_imgs/6306fffe-5944-4659-adea-055d00af89b0.png +3 -0
  20. control_imgs/64154.png +3 -0
  21. control_imgs/64154f.png +3 -0
  22. control_imgs/645888.png +3 -0
  23. control_imgs/661333b9-bf31-4c70-af83-293663497b98.png +3 -0
  24. control_imgs/667114.png +3 -0
  25. control_imgs/716523.png +3 -0
  26. control_imgs/7d3f1a9c-1945-4b5f-a686-2eb7aa6f8d89.png +3 -0
  27. control_imgs/8024eb55-ef05-4752-a1b8-4ad7351a8172.png +3 -0
  28. control_imgs/8880001.png +3 -0
  29. control_imgs/8880002.png +3 -0
  30. control_imgs/8880003.png +3 -0
  31. control_imgs/8880005.png +3 -0
  32. control_imgs/8880006.png +3 -0
  33. control_imgs/8880007.png +3 -0
  34. control_imgs/8880008.png +3 -0
  35. control_imgs/8880010.png +3 -0
  36. control_imgs/8880015.png +3 -0
  37. control_imgs/8880020.png +3 -0
  38. control_imgs/8880020f.png +3 -0
  39. control_imgs/8880021.png +3 -0
  40. control_imgs/8880021f.png +3 -0
  41. control_imgs/8880022.png +3 -0
  42. control_imgs/8880022f.png +3 -0
  43. control_imgs/8880023.png +3 -0
  44. control_imgs/8880023f.png +3 -0
  45. control_imgs/8880030.png +3 -0
  46. control_imgs/8880031.png +3 -0
  47. control_imgs/8880041.png +3 -0
  48. control_imgs/8880101.png +3 -0
  49. control_imgs/8880101f.png +3 -0
  50. control_imgs/8880106.png +3 -0
.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ preserved
2
+ __pycache__
alice_to_steve.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from PIL import Image
2
+
3
+ def alice_to_steve(alice):
4
+ for arm_loc, decor_offset in [((40, 16), (0,16)), ((32,48),(16,0))]:
5
+ for (size, loc, offset_x) in [
6
+ # Top and bottom
7
+ ((5,4),(arm_loc[0]+4+1, arm_loc[1]), 1),# Duplicate the middle pixel once
8
+ ((2,4),(arm_loc[0]+4+4+1, arm_loc[1]), 1),
9
+
10
+ # Front and back
11
+ ((9,12),(arm_loc[0]+4+1, arm_loc[1]+4), 1),
12
+ ((2,12),(arm_loc[0]+4+4+4+1, arm_loc[1]+4), 1),
13
+ ]:
14
+ for x in range(loc[0]+size[0]-1, loc[0]-1, -1):
15
+ for y in range(loc[1], loc[1]+size[1]):
16
+ alice.putpixel((x+offset_x, y), alice.getpixel((x, y)))
17
+ alice.putpixel((x+offset_x+decor_offset[0], y+decor_offset[1]), alice.getpixel((x+decor_offset[0], y+decor_offset[1])))
18
+ return alice
build_target_img.py ADDED
@@ -0,0 +1,300 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import argparse
2
+ import uuid
3
+ import concurrent.futures
4
+ from alice_to_steve import alice_to_steve
5
+ from PIL import Image
6
+ import os
7
+ import numpy as np
8
+ import asyncio
9
+ import mc_render
10
+ import random
11
+ from mc_voxel_texture_resolver import resolve_voxel_consistency
12
+
13
+ SCALING_RATIO = 12
14
+
15
+ IMAGE_WIDTH = 768
16
+ IMAGE_HEIGHT = 768
17
+
18
+ SCALING_RATIO = 12*IMAGE_HEIGHT/768
19
+
20
+ SKIN_MASK = "skin-mask.png"
21
+ SKIN_DECOR_MASK = "skin-decor-mask.png"
22
+
23
+ bg = (128,128,128)
24
+
25
+ def create_mask():
26
+ if os.path.exists(SKIN_MASK) and os.path.exists(SKIN_DECOR_MASK):
27
+ return
28
+
29
+ # 64*64
30
+
31
+ mask = Image.new('RGBA', (64, 64), (0, 0, 0, 0))
32
+ decor_mask = Image.new('RGBA', (64, 64), (0, 0, 0, 0))
33
+ for (size, offset, decor_offset) in [
34
+ # head
35
+ [(8,8),(0,8),(32,0)],
36
+ [(8,8),(8,8),(32,0)],
37
+ [(8,8),(8,0),(32,0)],
38
+ [(8,8),(16,8),(32,0)],
39
+ [(8,8),(16,0),(32,0)],
40
+ [(8,8),(24,8),(32,0)],
41
+
42
+ #left arm
43
+ [(4,12),(32,52),(16,0)],
44
+ [(4,12),(32+4,52),(16,0)],
45
+ [(4,12),(32+8,52),(16,0)],
46
+ [(4,12),(32+12,52),(16,0)],
47
+ [(4,4),(32+4,48),(16,0)],
48
+ [(4,4),(32+8,48),(16,0)],
49
+
50
+ #right arm
51
+ [(4,12),(40,20),(0,16)],
52
+ [(4,12),(40+4,20),(0,16)],
53
+ [(4,12),(40+8,20),(0,16)],
54
+ [(4,12),(40+12,20),(0,16)],
55
+ [(4,4),(40+4,16),(0,16)],
56
+ [(4,4),(40+8,16),(0,16)],
57
+
58
+ #body
59
+ [(8,4),(20,16),(0,16)],
60
+ [(8,4),(20+8,16),(0,16)],
61
+ [(8,12),(20,20),(0,16)],
62
+ [(8,12),(20+12,20),(0,16)],
63
+ [(4,12),(16,20),(0,16)],
64
+ [(4,12),(28,20),(0,16)],
65
+
66
+ #left leg
67
+ [(4,12),(16,52),(-16,0)],
68
+ [(4,12),(16+4,52),(-16,0)],
69
+ [(4,12),(16+8,52),(-16,0)],
70
+ [(4,12),(16+12,52),(-16,0)],
71
+ [(4,4),(16+4,48),(-16,0)],
72
+ [(4,4),(16+8,48),(-16,0)],
73
+
74
+ #right leg
75
+ [(4,12),(0,20),(0,16)],
76
+ [(4,12),(0+4,20),(0,16)],
77
+ [(4,12),(0+8,20),(0,16)],
78
+ [(4,12),(0+12,20),(0,16)],
79
+ [(4,4),(0+4,16),(0,16)],
80
+ [(4,4),(0+8,16),(0,16)],
81
+ ]:
82
+ mask.paste(Image.new('RGBA', size, (bg[0], bg[1], bg[2], 255)), offset)
83
+ decor_mask.paste(Image.new('RGBA', size, (bg[0], bg[1], bg[2], 255)), (offset[0]+decor_offset[0],offset[1]+decor_offset[1]))
84
+
85
+ mask.save(SKIN_MASK)
86
+ decor_mask.save(SKIN_DECOR_MASK)
87
+
88
+ create_mask()
89
+
90
+ def apply_mask(skin_image, skin_mask):
91
+ skin_image = Image.composite(skin_image, skin_mask, skin_mask)
92
+ return skin_image
93
+
94
+ def create_training_image(skin_image):
95
+
96
+ # Mask out any areas not directly mapping to the head, arm, leg, or
97
+ # torso portion of the character.
98
+ skin_image_first_layer = apply_mask(skin_image,Image.open(SKIN_MASK))
99
+ skin_image_second_layer = apply_mask(skin_image,Image.open(SKIN_DECOR_MASK))
100
+
101
+
102
+ training_image = Image.new('RGBA', (IMAGE_WIDTH, IMAGE_HEIGHT), (*bg, 255))
103
+ scaled_skin_image = skin_image.resize((int(32 * SCALING_RATIO), int(32 * SCALING_RATIO)),
104
+ resample=Image.BOX)
105
+ #scaled_first_layer = skin_image_first_layer.resize((int(32 * SCALING_RATIO), int(32 * SCALING_RATIO)),
106
+ # resample=Image.BOX)
107
+ #scaled_second_layer = skin_image_second_layer.resize((int(32 * SCALING_RATIO), int(32 * SCALING_RATIO)),
108
+ # resample=Image.BOX)
109
+
110
+ training_image.paste(scaled_skin_image, (0,0))
111
+ #training_image.paste(scaled_first_layer, (0,0))
112
+ #training_image.paste(scaled_second_layer, (int(32 * SCALING_RATIO),0))
113
+
114
+ # Optimized: Use NumPy for transparency and dot drawing
115
+ tr_arr = np.array(training_image)
116
+
117
+ # Fill transparent background areas
118
+ tr_arr[tr_arr[..., 3] == 0] = [*bg, 255]
119
+
120
+ # Draw white dots for skin transparency
121
+ skin_arr = np.array(skin_image)
122
+ y_indices, x_indices = np.where(skin_arr[..., 3] == 0)
123
+
124
+ for x, y in zip(x_indices, y_indices):
125
+ cx = int(int(x * SCALING_RATIO / 2) + SCALING_RATIO // 4)
126
+ cy = int(int(y * SCALING_RATIO / 2) + SCALING_RATIO // 4)
127
+ # Apply 2x2 white dot
128
+ tr_arr[cy-1:cy+1, cx-1:cx+1] = [255, 255, 255, 255]
129
+
130
+ training_image = Image.fromarray(tr_arr)
131
+
132
+ # skin_image -> np.ndarray
133
+
134
+ r_scale1 = 0.22
135
+ r_scale2 = 0.28
136
+ r_scale3 = 0.09
137
+ r_scale4 = 0.25
138
+ full_part = ['head','body','left_arm','right_arm','left_leg','right_leg']
139
+
140
+ limbs_offset = 0.8
141
+ default_pos_args = {
142
+ 'head': (0, 28, 0),
143
+ 'body': (0, 18, 0),
144
+ 'right_arm': (-6 - limbs_offset, 18, 0),
145
+ 'left_arm': (6 + limbs_offset, 18, 0),
146
+ 'right_leg': (-2 - limbs_offset, 6, 0),
147
+ 'left_leg': (2 + limbs_offset, 6, 0),
148
+ }
149
+
150
+ pos_args2 = {
151
+ 'head': (0, 28, 0),
152
+ 'body': (0, 18, 0),
153
+ 'right_arm': (-6, 18 , 0),
154
+ 'left_arm': (6, 18 , 0),
155
+ 'right_leg': (-2, 6, 0),
156
+ 'left_leg': (2, 6, 0),
157
+ }
158
+ for (ortho, s, look_at_y, core_display, decor_display, cam_front, offset,render_size, zoom, pos_args, walk) in [
159
+ (False, skin_image,12, full_part, full_part, (0.3, 0.4, 0.5), (int(IMAGE_WIDTH/2), 0), (int(IMAGE_WIDTH/2),int(IMAGE_HEIGHT/2*1.2)), r_scale1, default_pos_args, True),
160
+
161
+ (False, skin_image,12,full_part,full_part, (0.0, 0, 0.5),(0, int(IMAGE_HEIGHT/2)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/3)), 0.35, pos_args2, False),
162
+ (False, skin_image,12,full_part,full_part, (-0.0, -0.0, -0.5),(0, int(IMAGE_HEIGHT*3/4)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/3)), 0.35, pos_args2, False),
163
+
164
+ (False,skin_image_first_layer,12, full_part, full_part, (0.3, 0.4, 0.5), (int(IMAGE_WIDTH/5), int(IMAGE_HEIGHT/2)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/3)), r_scale2,default_pos_args, False),
165
+ (False,skin_image_first_layer,12, full_part, full_part, (-0.5, -0.4, -0.5), (int(IMAGE_WIDTH/5), int(IMAGE_HEIGHT*3/4)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/3)), r_scale2,default_pos_args, False),
166
+
167
+ #left
168
+ (False,skin_image,12, full_part, full_part, (0.3, 0.4, 0.5), (int(IMAGE_WIDTH*2/5), int(IMAGE_HEIGHT/2)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/3)), r_scale2,default_pos_args, False),
169
+ (False,skin_image,12, full_part, full_part, (-0.5, -0.4, -0.5), (int(IMAGE_WIDTH*2/5), int(IMAGE_HEIGHT*3/4)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/3)), r_scale2,default_pos_args, False),
170
+
171
+ # right
172
+ (False,skin_image, 12,full_part, full_part, (0.3, -0.4, 0.5),(int(IMAGE_WIDTH*3/5), int(IMAGE_HEIGHT/2)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/3)), r_scale2,default_pos_args, False),
173
+ (False,skin_image, 12,full_part, full_part, (-0.5, 0.4, -0.5),(int(IMAGE_WIDTH*3/5), int(IMAGE_HEIGHT*3/4)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/3)), r_scale2,default_pos_args, False),
174
+
175
+ # head
176
+ (False,skin_image,28, ['head'], ['head'], (-0.3, -0.4, 0.5),(int(IMAGE_WIDTH*4/5), int(IMAGE_HEIGHT/2)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/8)), r_scale3,default_pos_args, False),
177
+ (False,skin_image,28, ['head'], ['head'], (0.3, -0.4, 0.5),(int(IMAGE_WIDTH*4/5), int(IMAGE_HEIGHT/2 + IMAGE_HEIGHT/8)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/8)), r_scale3,default_pos_args, False),
178
+ (False,skin_image,28, ['head'], ['head'], (-0.5, -0.4, -0.5),(int(IMAGE_WIDTH*4/5), int(IMAGE_HEIGHT/2+ IMAGE_HEIGHT*2/8)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/8)), r_scale3,default_pos_args, False),
179
+ (False,skin_image,28, ['head'], ['head'], (0.5, -0.4, -0.5),(int(IMAGE_WIDTH*4/5), int(IMAGE_HEIGHT/2+ IMAGE_HEIGHT*3/8)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/8)), r_scale3,default_pos_args, False),
180
+
181
+ (False,skin_image,12, ['body'], ['body'], (0.3, 0.4, 0.5), (int(IMAGE_WIDTH*3/4*1.05), int(IMAGE_HEIGHT*1/5)), (int(IMAGE_WIDTH/4),int(IMAGE_HEIGHT/2)), r_scale4,default_pos_args, False),
182
+ (False,skin_image,12, ['body'], ['body'], (-0.3, 0.4, 0.5), (int(IMAGE_WIDTH*3/4*1.05), int(-IMAGE_HEIGHT*1/8)), (int(IMAGE_WIDTH/4),int(IMAGE_HEIGHT/2)), r_scale4,default_pos_args, False),
183
+
184
+ (False,skin_image,22, [], ['head'], (0.3, 0.3, 0), (int(IMAGE_WIDTH*1/2*0.95), int(IMAGE_HEIGHT*1/60)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/4.5)), r_scale4,default_pos_args, False),
185
+ (False,skin_image,22, [], ['head'], (-0.3, 0.3, 0), (int(IMAGE_WIDTH*1/2*0.95), int(IMAGE_HEIGHT*20/60)), (int(IMAGE_WIDTH/5),int(IMAGE_HEIGHT/4.5)), r_scale4,default_pos_args, False),
186
+
187
+ ]:
188
+ # Optimized: Get image directly from memory instead of UUID-named temp files
189
+ img_np = mc_render.render_skin(
190
+ skin=np.array(s),
191
+ output_size=render_size,
192
+ cam_front=cam_front,
193
+ look_at_y=look_at_y,
194
+ use_voxels=True,
195
+ ortho=ortho,
196
+ core_display=core_display,
197
+ decor_display=decor_display,
198
+ show_wireframe=False,
199
+ pos_args=pos_args,
200
+ rot_args={
201
+ 'rot_head': (0,0,0),
202
+ 'rot_arm_right': (-30,0,0),
203
+ 'rot_arm_left': (30,0,0),
204
+ 'rot_leg_right': (30,0,0),
205
+ 'rot_leg_left': (-30,0,0),
206
+ } if walk else {
207
+ 'rot_head': (0,0,0),
208
+ 'rot_arm_right': (0,0,0),
209
+ 'rot_arm_left': (0,0,0),
210
+ 'rot_leg_right': (0,0,0),
211
+ 'rot_leg_left': (0,0,0),
212
+ },save_path=None, transparent_background=True, zoom=zoom, light=True)
213
+
214
+ if img_np is not None:
215
+ x = Image.fromarray(img_np)
216
+ training_image.paste(x, offset, x)
217
+
218
+ return training_image
219
+
220
+ def check_skin(img):
221
+ is_alex = False
222
+ if img.size != (64, 64):
223
+ print('size invalid')
224
+ return False,is_alex
225
+ skin_image_first_layer = apply_mask(img,Image.open(SKIN_MASK))
226
+ # Calculate the total number of opaque pixels
227
+ count = 0
228
+ count2 = 0
229
+ for x in range(64):
230
+ for y in range(64):
231
+ if img.getpixel((x, y))[3] == 255:
232
+ count2 +=1
233
+ if skin_image_first_layer.getpixel((x, y))[3] == 255:
234
+ count += 1
235
+
236
+ if count == 1632 - 4*2*2-12*2*2:
237
+ is_alex = True
238
+
239
+ if count != 1632 and (not is_alex):
240
+ print('count invalid', count)
241
+ return False,is_alex
242
+
243
+ if count2 == 64*64 and (not is_alex):
244
+ print('count2 invalid')
245
+ return False,is_alex
246
+
247
+ return True,is_alex
248
+
249
+ def ensure_valid_skin(skin_image):
250
+ skin_image_first_layer = Image.open(SKIN_MASK)
251
+ skin_image_second_layer = Image.open(SKIN_DECOR_MASK)
252
+
253
+ # Convert all semi-transparent to opaque
254
+ for x in range(skin_image.width):
255
+ for y in range(skin_image.height):
256
+ if skin_image.getpixel((x, y))[3] != 0 and skin_image.getpixel((x, y))[3] != 255:
257
+ skin_image.putpixel((x, y), (skin_image.getpixel((x, y))[0], skin_image.getpixel((x, y))[1], skin_image.getpixel((x, y))[2], 255))
258
+ # Ignore other pixels in the 1st and 2nd layers of the skin
259
+ if skin_image_first_layer.getpixel((x, y))[3] != 255 and skin_image_second_layer.getpixel((x, y))[3] != 255:
260
+ skin_image.putpixel((x, y), (bg[0],bg[1],bg[2], 255))
261
+ return skin_image
262
+
263
+ def build_target_img(input_path, output_path):
264
+ # This might fail if dirs not created yet
265
+ # But main process creates them
266
+ try:
267
+ if not os.path.exists(input_path):
268
+ print('not exists', input_path)
269
+ return
270
+
271
+ # Ensure subdir exists in output
272
+ os.makedirs(os.path.dirname(output_path), exist_ok=True)
273
+
274
+ if os.path.exists(output_path):
275
+ print('exists target', output_path)
276
+ return
277
+
278
+ print(f"Processing {input_path}")
279
+ skin_image = Image.open(input_path)
280
+ skin_image = skin_image.convert('RGBA')
281
+ valid,is_alex = check_skin(skin_image)
282
+ if not valid:
283
+ print('invalid', input_path)
284
+ return
285
+ if is_alex:
286
+ skin_image = alice_to_steve(skin_image)
287
+
288
+ skin_image = ensure_valid_skin(skin_image)
289
+ skin_image = resolve_voxel_consistency(skin_image)
290
+ training_image = create_training_image(skin_image)
291
+ training_image.save(output_path)
292
+ except Exception as e:
293
+ print(f"Error processing {input_path}: {e}")
294
+
295
+ if __name__ == '__main__':
296
+ parser = argparse.ArgumentParser(description="Process a single Minecraft skin to a target image")
297
+ parser.add_argument("input_path", help="Path to input skin image")
298
+ parser.add_argument("output_path", help="Path to output target image")
299
+ args = parser.parse_args()
300
+ build_target_img(args.input_path, args.output_path)
build_target_imgs.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import sys
3
+ import subprocess
4
+ from concurrent.futures import ThreadPoolExecutor
5
+
6
+ output_dir = 'target_imgs_v73'
7
+
8
+ def process_skin(skin_id):
9
+ input_path = f'skins/{skin_id}.png'
10
+ output_path = f'{output_dir}/{skin_id}.png'
11
+ if not os.path.exists(output_path):
12
+ print(f"Starting process for skin: {skin_id}...")
13
+ # Run build_target_img.py as a separate subprocess using sys.executable
14
+ result = subprocess.run(
15
+ [sys.executable, 'build_target_img.py', input_path, output_path],
16
+ capture_output=True,
17
+ text=True
18
+ )
19
+ if result.returncode == 0:
20
+ print(f"Successfully processed: {skin_id}")
21
+ else:
22
+ print(f"Error processing skin {skin_id}:")
23
+ print(result.stderr or result.stdout)
24
+
25
+ def main():
26
+ os.makedirs(output_dir, exist_ok=True)
27
+ iset = set()
28
+ for i in os.listdir('skins'):
29
+ if i.endswith('.png') and not i.startswith('.'):
30
+ iset.add(i.split('.')[0])
31
+
32
+ # Process skins in parallel using a pool of subprocesses
33
+ # Using 4 workers for fast parallel rendering on Mac
34
+ max_workers = 4
35
+ print(f"Processing {len(iset)} skins using {max_workers} parallel workers...")
36
+ with ThreadPoolExecutor(max_workers=max_workers) as executor:
37
+ executor.map(process_skin, sorted(list(iset)))
38
+
39
+ if __name__ == '__main__':
40
+ main()
control_imgs/.DS_Store ADDED
Binary file (6.15 kB). View file
 
control_imgs/0042.png ADDED

Git LFS Details

  • SHA256: e08cd21d870d586a4ca7fac42239018882d05449fd200bc44e5aeeebfa3341b6
  • Pointer size: 131 Bytes
  • Size of remote file: 969 kB
control_imgs/12.png ADDED

Git LFS Details

  • SHA256: 4253d03363a26cb37494807ef4f5b820d640ae711bfab59975196ef543330b90
  • Pointer size: 132 Bytes
  • Size of remote file: 1.17 MB
control_imgs/17474.png ADDED

Git LFS Details

  • SHA256: 94248344a9f1147a28bcaaffd24049536ded5142e928ff207c413ad1e6ea9943
  • Pointer size: 131 Bytes
  • Size of remote file: 870 kB
control_imgs/1ed2b9af-0722-4869-8685-294610976cb5.png ADDED

Git LFS Details

  • SHA256: fa6be6e32ae2a0362be3c6f7be04155032b00042d761c12227b63404d6975d84
  • Pointer size: 131 Bytes
  • Size of remote file: 966 kB
control_imgs/222855.png ADDED

Git LFS Details

  • SHA256: d3229ba840c5475bde019c36480fcf24def86ed0408979bdb2b7a61082e21cfb
  • Pointer size: 131 Bytes
  • Size of remote file: 930 kB
control_imgs/408097.png ADDED

Git LFS Details

  • SHA256: c0e88b620fe6a4db1c9b0a3eca3cf51171477595893ed2bc24306f085139ea5e
  • Pointer size: 131 Bytes
  • Size of remote file: 509 kB
control_imgs/49ed3dbc-2d35-491c-b995-be54c59ab423.png ADDED

Git LFS Details

  • SHA256: b1e705f5a756ae690694e29d985ea2b7f6e7f76db5c216a2d414dbd1a4fee625
  • Pointer size: 131 Bytes
  • Size of remote file: 817 kB
control_imgs/517485.png ADDED

Git LFS Details

  • SHA256: d9bae660d8922565005eb13978acb4217783cb2c7e129f17dfe93b4026c8e463
  • Pointer size: 132 Bytes
  • Size of remote file: 1.42 MB
control_imgs/519494.png ADDED

Git LFS Details

  • SHA256: 6248b32f218f0aec08be8c708625b13d2cc99df6b6811e7fef77874e1dc38a1a
  • Pointer size: 132 Bytes
  • Size of remote file: 1.08 MB
control_imgs/525273.png ADDED

Git LFS Details

  • SHA256: 06d7f6ca7878ec4c6917510882e0b7bb44243788e630ef9128e08ebc519c969d
  • Pointer size: 132 Bytes
  • Size of remote file: 1.01 MB
control_imgs/538419.png ADDED

Git LFS Details

  • SHA256: 5ea4f95c08766ae06ab8b3cd80cda035e86f2531b4787045092f80399d1e1edb
  • Pointer size: 132 Bytes
  • Size of remote file: 1.36 MB
control_imgs/553045.png ADDED

Git LFS Details

  • SHA256: d17c8ecb37fa3c5af625d04ac6bf59b421f4dcf7a5d4cd02e1e318d64a18ad49
  • Pointer size: 132 Bytes
  • Size of remote file: 1.19 MB
control_imgs/560261.png ADDED

Git LFS Details

  • SHA256: 9743e1090507c5e4ed15f71ec2c50b5a4725f662bd01f44a0858be768c7f927e
  • Pointer size: 132 Bytes
  • Size of remote file: 1.45 MB
control_imgs/6306fffe-5944-4659-adea-055d00af89b0.png ADDED

Git LFS Details

  • SHA256: cee07764a403cfa748b5c2725ea1f61403361a0d907cc3493c2cc2f189ef3174
  • Pointer size: 131 Bytes
  • Size of remote file: 768 kB
control_imgs/64154.png ADDED

Git LFS Details

  • SHA256: 030964857b266f9a1eb06e84c4bf15701c6f4c649dc6927d1bfc2adc6375675c
  • Pointer size: 132 Bytes
  • Size of remote file: 1.41 MB
control_imgs/64154f.png ADDED

Git LFS Details

  • SHA256: 06076823b953a93d79513d26bc8bb8b7fbbc2811834a3f99a5b4fc08f55252cb
  • Pointer size: 132 Bytes
  • Size of remote file: 1.42 MB
control_imgs/645888.png ADDED

Git LFS Details

  • SHA256: 3a778ce0aa8ad672a0529e23b47dde41ba13e1833683d2f2c59869cf44500424
  • Pointer size: 132 Bytes
  • Size of remote file: 1.41 MB
control_imgs/661333b9-bf31-4c70-af83-293663497b98.png ADDED

Git LFS Details

  • SHA256: 4663751af1d5fffb453308173b781637a674b464a034bdafef52d4c553697ecd
  • Pointer size: 131 Bytes
  • Size of remote file: 820 kB
control_imgs/667114.png ADDED

Git LFS Details

  • SHA256: 362f97046ccb00d23239916687fda356d752060be6f34c12725f5850f2b64789
  • Pointer size: 132 Bytes
  • Size of remote file: 1.44 MB
control_imgs/716523.png ADDED

Git LFS Details

  • SHA256: bbcbb0fc977e704a7ac8465a9146e8b6f28b193859fc102445829fff078d927f
  • Pointer size: 132 Bytes
  • Size of remote file: 1.28 MB
control_imgs/7d3f1a9c-1945-4b5f-a686-2eb7aa6f8d89.png ADDED

Git LFS Details

  • SHA256: dac646f3a356defff6a67515c7c90aaa98793264262fa8fc74ba091803cf4bb1
  • Pointer size: 131 Bytes
  • Size of remote file: 997 kB
control_imgs/8024eb55-ef05-4752-a1b8-4ad7351a8172.png ADDED

Git LFS Details

  • SHA256: ca154f6fcaa7b98805d5da4e7038b15cc6d21b13f9f9646f86cea1d3aad55cad
  • Pointer size: 131 Bytes
  • Size of remote file: 789 kB
control_imgs/8880001.png ADDED

Git LFS Details

  • SHA256: 665353d212d6d74e667b7591577ca84e1a6634afd4b3cfaad44877df0fd4917b
  • Pointer size: 132 Bytes
  • Size of remote file: 1.54 MB
control_imgs/8880002.png ADDED

Git LFS Details

  • SHA256: 056440a6b6a6a0c20504cb3341546005bb34d7b7ba79b4a4dacfe4ac8f735c7a
  • Pointer size: 132 Bytes
  • Size of remote file: 1.24 MB
control_imgs/8880003.png ADDED

Git LFS Details

  • SHA256: 99894900759a45b04c1df84ccd6448aed85ee1998918cc2f48bed8bbaee99730
  • Pointer size: 131 Bytes
  • Size of remote file: 960 kB
control_imgs/8880005.png ADDED

Git LFS Details

  • SHA256: f445598be1eb76c7e9551292158554864ca972988443cbe1894f665509c439eb
  • Pointer size: 132 Bytes
  • Size of remote file: 1.28 MB
control_imgs/8880006.png ADDED

Git LFS Details

  • SHA256: 0f89fdac6d90853a86e3d9a1818a18950415abcca322c0bc6c7653b38f25fe1d
  • Pointer size: 131 Bytes
  • Size of remote file: 423 kB
control_imgs/8880007.png ADDED

Git LFS Details

  • SHA256: 644dd1397e3dac906653f6d291729171bdcdfbe4c917af627960c595d9901620
  • Pointer size: 132 Bytes
  • Size of remote file: 1.91 MB
control_imgs/8880008.png ADDED

Git LFS Details

  • SHA256: c7f9f6b50607c7f97218630a7df4ff06f4dbe16d09223c4c4ce3c054829a369d
  • Pointer size: 131 Bytes
  • Size of remote file: 422 kB
control_imgs/8880010.png ADDED

Git LFS Details

  • SHA256: c18a787db8fc4fd0324b88d576eca3ede3354087e4d3c0cd94f861b33034a761
  • Pointer size: 131 Bytes
  • Size of remote file: 961 kB
control_imgs/8880015.png ADDED

Git LFS Details

  • SHA256: d29ac403a35bc8030df43bd0ede5ab39e877a2564c27593b63b90da0da7c66ee
  • Pointer size: 132 Bytes
  • Size of remote file: 1.59 MB
control_imgs/8880020.png ADDED

Git LFS Details

  • SHA256: b96538dfde1ffd9d6e77902960747797cd336010b275b8553a87012535cdd825
  • Pointer size: 132 Bytes
  • Size of remote file: 1.67 MB
control_imgs/8880020f.png ADDED

Git LFS Details

  • SHA256: de3994a30672420d965cdc7e0464f1ec84ddf455f9a1d453a792d53bf1aeaead
  • Pointer size: 132 Bytes
  • Size of remote file: 1.67 MB
control_imgs/8880021.png ADDED

Git LFS Details

  • SHA256: 0f886a306c66a9b0d3d3ef9f21eb2366d0deabd5b7bc76f9d54516ff838b6c10
  • Pointer size: 132 Bytes
  • Size of remote file: 1.33 MB
control_imgs/8880021f.png ADDED

Git LFS Details

  • SHA256: 20fe565c92d5b2b9639091b25fc9880f5dab88770f47f970f48475fd57256ff2
  • Pointer size: 132 Bytes
  • Size of remote file: 1.33 MB
control_imgs/8880022.png ADDED

Git LFS Details

  • SHA256: d89e90589500db8b3909e17938cbf5243dba5d56a12774e071498aaf42dfa26e
  • Pointer size: 132 Bytes
  • Size of remote file: 1.04 MB
control_imgs/8880022f.png ADDED

Git LFS Details

  • SHA256: 3d453727b26afd1f0065b2bbfa087928c4f48ef1224f365873b3e3fce96695dd
  • Pointer size: 132 Bytes
  • Size of remote file: 1.04 MB
control_imgs/8880023.png ADDED

Git LFS Details

  • SHA256: c7fa51d973536d193443f6cd61e954cd08419417004dea664fd5c11ff5c36be1
  • Pointer size: 132 Bytes
  • Size of remote file: 1 MB
control_imgs/8880023f.png ADDED

Git LFS Details

  • SHA256: e267e638a53f5fe024e1218ad9215db181c3d0c4730ba9a21c9b4795f5c6e2da
  • Pointer size: 132 Bytes
  • Size of remote file: 1.13 MB
control_imgs/8880030.png ADDED

Git LFS Details

  • SHA256: a0e634fa6a4ca0297238f9a164607883ca4bf9e7375815ebd1cfd12af24e2d22
  • Pointer size: 131 Bytes
  • Size of remote file: 582 kB
control_imgs/8880031.png ADDED

Git LFS Details

  • SHA256: 50bb093a7612ce09b64dd24db286558819de0e96090bd0e46db05f5390519bea
  • Pointer size: 131 Bytes
  • Size of remote file: 463 kB
control_imgs/8880041.png ADDED

Git LFS Details

  • SHA256: 8a4551bcb2786993733bfd9754d0985475eb6df9e9d55c10ab07d5d3d856c21a
  • Pointer size: 131 Bytes
  • Size of remote file: 918 kB
control_imgs/8880101.png ADDED

Git LFS Details

  • SHA256: c8b6adbc2f298e3c71976a7a93ea3c797ea3dcd008540264768fb0d718c7e55b
  • Pointer size: 131 Bytes
  • Size of remote file: 956 kB
control_imgs/8880101f.png ADDED

Git LFS Details

  • SHA256: 45ea6bd42b20cd99d3dac8ac7e2d13fcc680f093ceeefc011cb8c1657f1b0b46
  • Pointer size: 131 Bytes
  • Size of remote file: 954 kB
control_imgs/8880106.png ADDED

Git LFS Details

  • SHA256: 4065caec38facba5e4f7040820c5763d3b293db411e85f177f8dab61681b0e6e
  • Pointer size: 132 Bytes
  • Size of remote file: 1.32 MB