Skip to content

Convert a 64x32 skin to 64x64, restore the alpha channel, define a slim(Alex) skin, and also clear unused areas.

License

Notifications You must be signed in to change notification settings

Frysuni/minecraft-skin-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minecraft skin converter

This package allows you to convert a 64x32 skin to 64x64, restore the alpha channel, define a slim(Alex) skin, and also clear unused areas. The package also supports HD format skins. It's ES5 import/export, but also contains default import for ES6.

It supports hd skins, jpg skins, new format skins for input. The output skin will always be of the same format as shown in the example.

Warning! The definition of slim skins may be inaccurate due to poor-quality skin sources, although I did it as accurately as possible. Use this only as an auxiliary skin detection tool and give the choice to the person.


Installation:

npm i minecraft-skin-converter

intro

Usage example:

import MinecraftSkinConverter from 'minecraft-skin-converter';
// or for ES5:
const { MinecraftSkinConverter } = require('minecraft-skin-converter');

async function boot() {
    const converter = new MinecraftSkinConverter('./skininput.png', 'buffer/png');
    // or 'base64/png' for the base64 data type

    await converter.convertSkin().catch(console.error);
    // returns { slim: false, hd: false, skinpath: './skininput.png', dataType: 'buffer/png', data: [Buffer] }

    converter.isSlim;
    // returns false
    // or undefined if convertSkin was not executed

    await converter.getSkinHead(64).catch(console.error);
    // 64 is the avatar rescale from 8x8(default minimum) to 64x64
    // a multiple of 2 is recommended
    // regardless of convertSkin()
    // returns { size: 64, skinpath: './skininput.png', dataType: 'buffer/png', data: [Buffer]; }
}

boot();

About

Convert a 64x32 skin to 64x64, restore the alpha channel, define a slim(Alex) skin, and also clear unused areas.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published