@altie122-studios/mc-animation-converter
v1.3.1
Published
Takes .png and .png.mcmeta files and converts them into one of a growing number of animation formats.
Maintainers
Readme
MC animation converter
Takes .png and .png.mcmeta files and converts them into one of a growing number of animation formats.
APNG export is recommended for most use cases, as it is lossless and supports transparency better than GIFs.
Installation
npm i @altie122-studios/mc-animation-converterUsage
APNG
import { convert } from "@altie122-studios/mc-animation-converter";
const input = {
png: fs.readFileSync("path/to/image.png"),
mcmeta: fs.readFileSync("path/to/image.png.mcmeta"),
};
const output = await convert(input);
fs.writeFileSync("path/to/output.apng", output.export);GIF
import { convert } from "@altie122-studios/mc-animation-converter";
const input = {
png: fs.readFileSync("path/to/image.png"),
mcmeta: fs.readFileSync("path/to/image.png.mcmeta"),
};
const output = await convert({
...input,
exportType: "gif",
});
fs.writeFileSync("path/to/output.gif", output.export);working example in /test/test.js
License
MIT
Credits
- UPNG.js (seen at /src/dep/UPNG.js/UPNG.js)
- DefinitelyTyped/upng-js (types in the /src/dep/UPNG.js/UPNG.js folder)
Big thanks to this Minecraft Forum post for helping make understanding how minecraft animations work way more possible.
