Giter Club home page Giter Club logo

Comments (10)

awxkee avatar awxkee commented on June 23, 2024

I've tried your demo but I still getting a constant result.
May I have some sample image? Do you use x86 Intel mac or M* Apple Silicon?
image

from jxl-coder-swift.

awxkee avatar awxkee commented on June 23, 2024

Try 1.3.2 version. I think it may solve the issue

from jxl-coder-swift.

mgenware avatar mgenware commented on June 23, 2024

Still repros on 1.3.2. I tried multiple files, some never hit this. One particular file seems to have a much higher chance.

I'm on M2 Pro, macOS 13.5.1 (22G90)

image

Attached the zip of that file:

1.zip

from jxl-coder-swift.

awxkee avatar awxkee commented on June 23, 2024

Try out 1.3.3 version. It should works correctly

from jxl-coder-swift.

mgenware avatar mgenware commented on June 23, 2024

Upgraded to 1.3.3, now it's 100% 33KB instead of 166KB:

image

from jxl-coder-swift.

awxkee avatar awxkee commented on June 23, 2024

Yes, it is expected. Bug was producing invalid background colors that was increasing a file size

from jxl-coder-swift.

mgenware avatar mgenware commented on June 23, 2024

Both cjxl -q 100 and squoosh.app (lossless) produce a 177KB jxl

from jxl-coder-swift.

awxkee avatar awxkee commented on June 23, 2024

Yes, because it may detect that original file uses RGBA ( 4 channel with alpha ) and compress it in RGBA. If you'll set colorSpace: .rgba in encoder parameters you will get close result to it. Default value is rgb that replaces alpha channel to black that you may have already noticed in result files. I add that implicit option to choose compressing in RGB or RGBA since in Apple platform almost no clear ways to understand original pixel format because it must be always be redrawn in premultiplied RGBA pixel format. And RGB was chosen as default because primary target of JPEG XL is photos that do not contains alpha channel.

from jxl-coder-swift.

awxkee avatar awxkee commented on June 23, 2024

So the main responsibility to choose between RGB or RGBA pixel format is delegated to the caller

from jxl-coder-swift.

mgenware avatar mgenware commented on June 23, 2024

I see. Thanks for the explanation. Can confirm it's working after switching to .rgba.

from jxl-coder-swift.

Related Issues (4)

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.