Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using jpegxl or other imagecodecs #4

Open
satra opened this issue Apr 23, 2024 · 4 comments
Open

using jpegxl or other imagecodecs #4

satra opened this issue Apr 23, 2024 · 4 comments

Comments

@satra
Copy link

satra commented Apr 23, 2024

posted a snippet on using the jpegxl converter here: https://forum.image.sc/t/jpeg-xl-compression/93656/2

@balbasty
Copy link
Collaborator

I get a page not found

@satra
Copy link
Author

satra commented Apr 23, 2024

perhaps it requires signing in.

@balbasty
Copy link
Collaborator

I have created an account but it still tells me "Oops! That page doesn’t exist or is private."

Maybe I need to suscribe to some channel?

@satra
Copy link
Author

satra commented Apr 23, 2024

sorry, it seems like it was a dm. here you go.

hopefully this gets you going in the right direction. the minimal environment: pip install imagecodecs-numcodecs s3fs zarr dask to run the following code

import numpy as np
import dask.array as da
import zarr

from imagecodecs.numcodecs import Jpegxl
from imagecodecs import jpegxl_version

print(jpegxl_version())

level = 4
s3arr = da.from_zarr(f"s3://dandiarchive/zarr/427771c5-9047-4d99-bc48-a26ea3e1e56d/{level}/")
s3arr_in_mem = np.squeeze(s3arr.compute())

compressor= Jpegxl(distance=0.5, lossless=False, effort=1, numthreads=10)

store = zarr.DirectoryStore('test.jxl.zarr', dimension_separator="/")
root = zarr.group(store=store, overwrite=True)
foo = root.create_dataset('0', data=s3arr_in_mem, chunks=(128, 128, 128), compressor=compressor)
store.close()
foo.info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants