Code Monkey home page Code Monkey logo

Comments (5)

blitzbohne avatar blitzbohne commented on May 26, 2024

Seems it is the same issue as stated here:

#40

When I call compress via

const pres = UPNG.encode.compress(
frames.map(frame => frame.data),
frames[0].width,
frames[0].height,
256,
[true, false, false, 0, false]
)

instead of

const pres = UPNG.encode.compress(
frames.map(frame => frame.data),
frames[0].width,
frames[0].height,
256,
[false, false, false, 0, false]
)

So I enforce blend its gone. However this can not be the idea right? Any idea what's wrong? @photopea

from upng.js.

blitzbohne avatar blitzbohne commented on May 26, 2024

test2

^^ This is the original GIF I used

express-new-test (22)

^^ This is generated gif with artifacts (slow-mo so u can see) AFTER my proposed typo fix so regions are set correctly but WITHOUT setting alwaysBlend to true

express-new-test (25)

^^ This is the generated gif with alwaysBlend set to true and the region fix proposed. This has no more artifacts but I surely do not want to enforce blending if not possible to the second case seem to be broken?

Btw great library!

from upng.js.

photopea avatar photopea commented on May 26, 2024

Hi, are you talking about this?

var pimg = new Uint8Array(bufs[j-1-it]), p32 = new Uint32Array(bufs[j-1-it]);

If the array "bufs" is the array of ArrayBuffers, the "bufs[j-1-it]" should be equal to pimg.buffer . Are you sure you are not sending Uint8Arrays in "bufs"?

from upng.js.

blitzbohne avatar blitzbohne commented on May 26, 2024

@photopea I am actually sending the image data directly which is an UInt8 array that might have been the mistake indeed though changing the code line accordingly fixes it too and one can directly send canvas image data ;)

from upng.js.

photopea avatar photopea commented on May 26, 2024

When you have a Uint8Array, use the .buffer property to access its ArrayBuffer. I am not a fan of allowing multiple types as a parameter of a function. Just pre-process the input data before givint it to UPNG.

from upng.js.

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.