jxlpy icon indicating copy to clipboard operation
jxlpy copied to clipboard

Support for L colorspace and extra channels.

Open alexjc opened this issue 3 years ago • 10 comments

For the record in case people are looking: I have implemented both these features in my own branch at https://github.com/alexjc/jxlpy.

Just need to merge #13 first, then I'll port them over!

alexjc avatar Nov 25 '22 10:11 alexjc

@alexjc Thanks for your awesome work. Unfortunately I've run into an issue with Github actions package building and I have little time to fix it lately. It might also resolve the #10 issue building wheels for Windows and Mac OS. I would like to fix that first in order to make PyPI release with prebuilt wheels. If you have any ideas on how to manage building wheel packages for jxlpy in Github actions I would appreciate any help.

olokelo avatar Nov 30 '22 13:11 olokelo

Is there any more information than in #10?

alexjc avatar Nov 30 '22 13:11 alexjc

Not really. The current build pipeline is a bit hacky, it uses CIBW_BEFORE_ALL to build libjxl and then cibuildwheel to build and fix Python package. The libjxl build instructions are Linux specific and use some workarounds which don't work anymore with latest version of libjxl. I had ran into issues trying to split build process into steps.

olokelo avatar Nov 30 '22 14:11 olokelo

How do you test it locally? I'll take a look.

alexjc avatar Nov 30 '22 16:11 alexjc

If you could merge #13 that would help, so I can get it working with the latest version.

alexjc avatar Nov 30 '22 16:11 alexjc

How do you test it locally? I'll take a look.

I tested it with Act. Thanks :)

If you could merge #13 that would help, so I can get it working with the latest version.

Okay, will do.

olokelo avatar Nov 30 '22 16:11 olokelo

Awesome! Merged, Thanks again :)

I've also somewhat tested your master branch and it seems like your change in get_frame breaks printing pixel colors in examples. Could you please review it?

olokelo avatar Nov 30 '22 19:11 olokelo

Oh, yes I know what that is — relates to the extra channels. I will fix it...

alexjc avatar Nov 30 '22 21:11 alexjc

Unfortunately, my implementation of L and I;16 modes from PIL doesn't work. It seems to use a different stride somewhere and I don't know where it is...

I set num_channels, num_color_channels, and bits_per_sample correctly — something missing. Advice welcome!

EDIT: Image too big to inline, but you can view it here: https://user-images.githubusercontent.com/445208/223972746-69abf54b-7920-48ef-bbfe-8f4f8a4eebbb.jpg

alexjc avatar Mar 09 '23 09:03 alexjc

OK, it's fixed it was a bug in ImageMagick actually.

alexjc avatar Mar 09 '23 21:03 alexjc