Skip to content

Encodes / decodes to and from MCPE SkinData & Images

Notifications You must be signed in to change notification settings

Suremeo/skinconverter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Examples

Skin Data to PNG

	dat, err := ioutil.ReadFile("Skin.dat")
	if err != nil {
		panic(err)
	}

	img := SkinConverter.SkinDataToImage(dat)

	save := bytes.NewBuffer(nil)

	err = png.Encode(save, img)
	if err != nil {
		panic(err)
	}

	err = ioutil.WriteFile("Skin.png", save.Bytes(), os.ModePerm)
	if err != nil {
		panic(err)
	}

PNG to Skin Data

	data, err := ioutil.ReadFile("Skin.png")

	pngimage, err := png.Decode(bytes.NewBuffer(data))
	if err != nil {
		panic(err)
	}

	skindata := SkinConverter.ImageToSkinData(pngimage)

	err = ioutil.WriteFile("Skin.dat", skindata, os.ModePerm)
	if err != nil {
		panic(err)
	}

About

Encodes / decodes to and from MCPE SkinData & Images

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages