Git Product home page Git Product logo

Comments (6)

NoelFB avatar NoelFB commented on May 26, 2024 1

Often the premultiply process is applied in a pre-build step to make loading at runtime faster. If images automatically performed this step on-load it would break any images that have already had this process applied (and also be much slower if you don't care about premultiplying the image).

So yes, it's currently all intentional. I'm not against making this process more clear, though, and perhaps adding more ways to simplify the process. It might also be nice to make a normal non-premultiplied blend option that can be used if you don't want to use the premultiply blending.

from foster.

kuujoo avatar kuujoo commented on May 26, 2024

Batcher uses 'premultiplied alpha' blending mode, but I'm not sure if Aseprite premultiplies images by default.

Try to premultiply images:

 Aseprite sp = new Aseprite("Content/Sprites/test.ase");
 var image = sp.RenderFrame(0);
 image.Premultiply();
 _tex = new Texture(image);

from foster.

codecat avatar codecat commented on May 26, 2024

Calling Premultiply() seemed to work! I am actually just using png's though, not .ase files for rendering these.

Image = new Image(path);
Image.Premultiply();

Is that the intended workflow, to call Premultiply() if needed?

from foster.

kuujoo avatar kuujoo commented on May 26, 2024

I think Foster should automatically call it, since Batcher uses premultiplied blending by default.

@NoelFB

from foster.

codecat avatar codecat commented on May 26, 2024

I see, that makes sense! Is there any information on the process of premultiplying images outside of at runtime?

from foster.

NoelFB avatar NoelFB commented on May 26, 2024

Generally

Is there any information on the process of premultiplying images outside of at runtime?

Generally you can just apply the premultiply and then save it as a .png/.qoi again. Or alternatively save it in some custom format for faster loading.

With the addition of NonPremultiplied blendmode I think I'll close this but later on when there's more docs making this clearer would be good.

from foster.

Related Issues (20)

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.