Skip to content

unn4m3d/mineskin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MineSkin

A gem to manipulate Minecraft skins and capes [WIP]

Currently its only features are extracting skin or cape data and rendering 2D previews

You can find documentation here

Installation

gem install mineskin

Usage

require 'mineskin'
data = MineSkin::SkinData.new("my_skin.png")
data.head # => #<MineSkin::Cuboid ... >
data.head.top # => #<MineSkin::Texture ... >
data.head.top.texture # => #<Magick::Image ... >
data.head.top.overlay # => Magick::Image or nil

preview = MineSkin::Preview::Skin2D.new(data)
# background is white by default
image = preview.render(640, background: 'white') # => Magick::Image
image.format = "png"
File.open("output.png","w"){ |f| f.write image.to_blob }

# Cape operations are the same
cape = MineSkin::CapeData.new("my_cape.png")
cape.cape # => #<MineSkin::Cuboid ... >

cape_preview = MineSkin::Preview::Cape2D.new(data)
cape_image = preview.render(640) # => Magick::Image
cape_image.format = "png"
File.open("output.png","w"){ |f| f.write cape_image.to_blob }

Example of output.png:

Example

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages