minecraft-skin-converter
TypeScript icon, indicating that this package has built-in type declarations

1.4.6 • Public • Published

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.


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();

Package Sidebar

Install

npm i minecraft-skin-converter

Weekly Downloads

5

Version

1.4.6

License

MIT

Unpacked Size

21.4 kB

Total Files

5

Last publish

Collaborators

  • frys