Views
No views yet
<image>\nPlease analyze this Minecraft skin render (front and back views) and extract its visual attributes, character identity, and a detailed description.1# pip install MinePI
2from minepi import Skin
3
4async def render_skin_multiview(
5 raw_skin_img: Image.Image,
6 ratio: int = 12,
7 bg_color: tuple = (245, 245, 245, 255)
8) -> Image.Image:
9 """
10 Input a minecraft skin (64x64 or 64x32)
11 """
12 skin = Skin(raw_skin=raw_skin_img)
13
14 im_front_3d = await skin.render_skin(vr=10, hr=25, ratio=ratio, display_second_layer=True, aa=True)
15 im_back_3d = await skin.render_skin(vr=10, hr=205, ratio=ratio, display_second_layer=True, aa=True)
16
17 def clean_bg(im, target_height):
18 w_percent = target_height / float(im.height)
19 target_width = int(float(im.width) * float(w_percent))
20 im_resized = im.resize((target_width, target_height), Image.Resampling.LANCZOS)
21
22 bg = Image.new("RGBA", im_resized.size, bg_color)
23 bg.paste(im_resized, (0, 0), im_resized)
24 return bg.convert("RGB")
25
26 target_h = 512
27 img_front = clean_bg(im_front_3d, target_h)
28 img_back = clean_bg(im_back_3d, target_h)
29
30 views = [img_front, img_back]
31 total_w = sum(v.width for v in views)
32 collage = Image.new("RGB", (total_w, target_h), (245, 245, 245))
33
34 curr_x = 0
35 for v in views:
36 collage.paste(v, (curr_x, 0))
37 curr_x += v.width
38
39 return collage1{
2 "identity": {
3 "name": "White Princess",
4 "franchise": "Original/None",
5 "entity_type": "people"
6 },
7 "visual_tags": {
8 "archetypes": "princess, royal, fairy",
9 "hair": "short black hair, fringe over the eyes",
10 "face_and_eyes": "big green eyes, pale skin",
11 "top": "white dress with green trim, green sash",
12 "bottom": "white skirt, green trim",
13 "footwear": "bare feet",
14 "accessories": "pink and purple crown, green sash",
15 "motifs": "crown, sash",
16 "themes_and_vibes": "royalty, fairytale, cute, elegant"
17 },
18 "caption": "A pale girl with short black hair and big green eyes, wearing a pink and purple crown with a gold band. Her white dress is trimmed with green all the way around the sleeves, waist and skirt, with a matching green sash tied at the front. Her bare feet show through the white.",
19 "short_caption": "A pale girl in a white dress with a pink and purple crown.",
20 "keywords": "princess, white princess, crown, crown girl, white dress, green eyes, fairy, royal, fairy tale, cute girl, girl skin, white princess skin, pink crown, green sash, royal girl, princess skin, white and green, fairy girl, crown girl, elegant, royal princess, white dress girl"
21}