Project

mineskin

0.0
No commit activity in last 3 years
No release in over 3 years
A tool to manipulate minecraft skins
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

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