I still trying to figure stuff out so I might be doing something wrong but I am unable to convert any image with an alpha channel while keeping the alpha channel and any help in this matter is really appreciated.
Tried on
jpegxl-rs = { version = "0.11.0", features = ["vendored"] } and
jpegxl-rs = { version = "0.10.4", features = ["vendored"] }
To recognize the alpha channel in the original image data, you need to create an EncoderFrame manually, and set the number of channels there. There's also an example in the tests.
To keep the alpha channel in the produced image, set it in the builder.
Converting the following sample image whose sample.color() shows as Rgba16: with the following code
produces the following garbled image: (uploading a screenshot as github doesn't allow jxl images)
while encoding the same image as rgb16 works fine and produces the following image:
.
I still trying to figure stuff out so I might be doing something wrong but I am unable to convert any image with an alpha channel while keeping the alpha channel and any help in this matter is really appreciated.
Tried on jpegxl-rs = { version = "0.11.0", features = ["vendored"] } and jpegxl-rs = { version = "0.10.4", features = ["vendored"] }