cgohlke / imagecodecs

Image transformation, compression, and decompression codecs
https://pypi.org/project/imagecodecs
BSD 3-Clause "New" or "Revised" License
111 stars 21 forks source link

codec not available: 'imagecodecs_jpegxl' #82

Closed MosGeo closed 11 months ago

MosGeo commented 11 months ago

Hello,

I am hitting the codec not available error when trying to create a zarr array with the jpeg compressers. In the example below, the jpegxl_encode works. It is just the zarr compressor that is hitting the issue.

Now, I am on Windows 64bit and I tested on both Windows 10 and Windows 11. Both are using Python 10. So it is not the issue in #74 .

Any advise would be appreciated

import numpy as np
import zarr
from imagecodecs.numcodecs import Jpegxl
from imagecodecs import jpegxl_encode

data = np.random.randint(0, 256, size=(1000,1000), dtype=np.uint8)

# This works
encoded = jpegxl_encode(data)

# This crashes
z = zarr.array(data, compressor=Jpegxl())
cgohlke commented 11 months ago

Did you register the codec with numcodecs/zarr like shown in the JPEG2K example:

https://github.com/cgohlke/imagecodecs/blob/57ea74b0e1d8bf78f10a74d0ee896eee36eaf65c/imagecodecs/imagecodecs.py#L464-L476

Alternatively, install the imagecodecs-numcodecs package, which defines numcodecs entry points.

MosGeo commented 11 months ago

No, I didn't register it 🤣 I am new at this stuff so I didn't know I had to. All good now :)