Skin
Skin is a pattern-useful type that represents a raw skin image as separate body parts accessible via properties, and also provides skin metadata.
Initialization
Section titled “Initialization”from wavy_totem_lib import Skin
skin = Skin( filepath='my_skin.png', slim=True)Skin accepts 2 arguments:
filepath:Union[str, bytes, Path, IO[bytes]]— the skin image as bytes or a path to it. Passed unchanged toPIL.Image.open().slim:bool(Optional. Defaults to EllipsisType) — a boolean value indicating whether the skin is slim. If EllipsisType (aka...) is passed, the type will attempt to automatically determine the skin size.
For Pattern Creators
Section titled “For Pattern Creators”Metadata Properties
Section titled “Metadata Properties”image:PIL.Image— contains the entire image. Forces the use of the RGBA color profile.version:str— the skin version. Can have the valuenewfor 64x64 skins that support the second layer, andoldfor 64x32 skins that do not support it.available_second:bool— indicates whether the skin supports the second layer. The value depends onversion.is_slim:bool— indicates whether the skin is slim. This value can be forced during initialization.
Properties Containing Body Parts
Section titled “Properties Containing Body Parts”All these “properties” are actually methods with the @property decorator to save memory and CPU time.
-
right_leg— the right leg.Returns a dictionary with keys
front,back,left,right,top,bottomand a PIL.Image as the value. -
right_leg_front— the front of the right leg.Returns a PIL.Image. Equivalent to
right_leg()['front'], but uses fewer resources because it doesn’t calculate all sides. -
right_leg_second— the second layer of the right leg.Returns a dictionary with keys
front,back,left,right,top,bottomand a PIL.Image as the value, if the second layer is available. Otherwise returnsNone. -
right_leg_second_front— the front of the second layer of the right leg.Returns a PIL.Image if the second layer is available, otherwise
None. Equivalent toright_leg_second()['front']if the second layer is available, but uses fewer resources. -
left_leg— the left leg.Returns a dictionary with keys
front,back,left,right,top,bottomand a PIL.Image as the value. For old skins, returns the same asright_leg. -
left_leg_front— the front of the left leg.Returns a PIL.Image. For old skins, returns the same as
right_leg_front. Equivalent toleft_leg()['front'], but uses fewer resources. -
left_leg_second— the second layer of the left leg.Returns a dictionary with keys
front,back,left,right,top,bottomand a PIL.Image as the value, if the second layer is available. Otherwise returnsNone. -
left_leg_second_front— the front of the second layer of the left leg.Returns a PIL.Image if the second layer is available, otherwise
None. Equivalent toleft_leg_second()['front']if the second layer is available, but uses fewer resources. -
right_hand— the right hand.Returns a dictionary with keys
front,back,left,right,top,bottomand a PIL.Image as the value. Accounts for the skin type (slim/wide). -
right_hand_front— the front of the right hand.Returns a PIL.Image. Accounts for the skin type (slim/wide). Equivalent to
right_hand()['front'], but uses fewer resources. -
right_hand_second— the second layer of the right hand.Returns a dictionary with keys
front,back,left,right,top,bottomand a PIL.Image as the value, if the second layer is available. Otherwise returnsNone. Accounts for the skin type (slim/wide). -
right_hand_second_front— the front of the second layer of the right hand.Returns a PIL.Image if the second layer is available, otherwise
None. Accounts for the skin type (slim/wide). Equivalent toright_hand_second()['front']if the second layer is available, but uses fewer resources. -
left_hand— the left hand.Returns a dictionary with keys
front,back,left,right,top,bottomand a PIL.Image as the value. For old skins, returns the same asright_hand. Accounts for the skin type (slim/wide). -
left_hand_front— the front of the left hand.Returns a PIL.Image. For old skins, returns the same as
right_hand_front. Accounts for the skin type (slim/wide). Equivalent toleft_hand()['front'], but uses fewer resources. -
left_hand_second— the second layer of the left hand.Returns a dictionary with keys
front,back,left,right,top,bottomand a PIL.Image as the value, if the second layer is available. Otherwise returnsNone. Accounts for the skin type (slim/wide). -
left_hand_second_front— the front of the second layer of the left hand.Returns a PIL.Image if the second layer is available, otherwise
None. Accounts for the skin type (slim/wide). Equivalent toleft_hand_second()['front']if the second layer is available, but uses fewer resources. -
body— the body.Returns a dictionary with keys
front,back,left,right,top,bottomand a PIL.Image as the value. -
body_front— the front of the body.Returns a PIL.Image. Equivalent to
body()['front'], but uses fewer resources. -
body_second— the second layer of the body.Returns a dictionary with keys
front,back,left,right,top,bottomand a PIL.Image as the value, if the second layer is available. Otherwise returnsNone. -
body_second_front— the front of the second layer of the body.Returns a PIL.Image if the second layer is available, otherwise
None. Equivalent tobody_second()['front']if the second layer is available, but uses fewer resources. -
head— the head.Returns a dictionary with keys
front,back,left,right,top,bottomand a PIL.Image as the value. -
head_front— the front of the head.Returns a PIL.Image. Equivalent to
head()['front'], but uses fewer resources. -
head_second— the second layer of the head.Returns a dictionary with keys
front,back,left,right,top,bottomand a PIL.Image as the value, if the second layer is available. Otherwise returnsNone. -
head_second_front— the front of the second layer of the head.Returns a PIL.Image if the second layer is available, otherwise
None. Equivalent tohead_second()['front']if the second layer is available, but uses fewer resources.