GithubHelp home page GithubHelp logo

keyboarddanni / asefile Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alpine-alpaca/asefile

0.0 0.0 0.0 6.78 MB

Library for loading Aseprite files. Directly reads binary Aseprite files and does not require you to export files to JSON.

License: MIT License

Rust 90.99% Shell 0.09% C++ 8.92%

asefile's Introduction

asefile

Build status crates.io Documentation

Utilities for loading Aseprite files. This library directly reads the binary Aseprite files (specification) and does not require you to export files to JSON. This should make it fast enough to load your assets when the game boots up (during development). You can also use it to build your own asset pipelines.

Documentation | Changelog

Example

use std::path::Path;

use asefile::AsepriteFile;
use image::{self, ImageFormat};

fn main() {
    let file = Path::new("input.aseprite");
    // Read file into memory
    let ase = AsepriteFile::read_file(&file).unwrap();
    // Write one output image for each frame in the Aseprite file.
    for frame in 0..ase.num_frames() {
        let output = format!("output_{}.png", frame);
        // Create image in memory, then write it to disk as PNG.
        let img = ase.frame(frame).image();
        img.save_with_format(output, ImageFormat::Png).unwrap();
    }
}

Unsupported Features

The following features of Aseprite 1.2.25 are currently not supported:

  • color profiles

Bug compatibility

  • For indexed color files Aseprite supports blend modes, but ignores them when exporting the image. The images constructed by asefile currently match the in-editor preview.

  • Aseprite has a bug in its luminance and color blend modes. Since this is the same in editor and in exported files, asefile reproduces this bug. (If Aseprite fixes this, asefile will fix this bug based on the version that the file was generated with.)

asefile's People

Contributors

b-reif avatar alpine-alpaca avatar sanbox-irl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.