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

Known lossy compression filters to use with h5wasm #24

Closed
Carnageous opened this issue May 10, 2022 · 2 comments
Closed

Known lossy compression filters to use with h5wasm #24

Carnageous opened this issue May 10, 2022 · 2 comments

Comments

@Carnageous
Copy link

Hello! I know this issue is not really h5wasm-related, but I figured you might be able to give me some hints regarding libraries that implement lossy compression filters listed in the HDF5 docs.

Do you know of any libary that supports lossy compression that can be used with javascript or WASM? Idealy it should also have a h5py counterpart. Are custom filters even supported by h5wasm?

@bmaranville
Copy link
Member

In principle you can compile h5wasm in "main module" mode and compile plugins in "side module" mode, and then load them at runtime. When I tried this it resulted in a much larger WASM file for the h5wasm core, but it did work. You could also statically compile the plugin and then link it when building h5wasm, and the plugin would then be "built-in".

I don't have much of an opinion on the (3?) lossy compression algorithms listed in the docs as you linked - I haven't used them (though I see lots of information in https://gmd.copernicus.org/articles/12/4099/2019/). There's also a built-in "Scale-Offset" filter in HDF5 that lets you save data with a tunable precision, saving space.

If you need help trying to compile and link a filter - just let me know and I will dig up notes from my earlier experiment.

@Carnageous
Copy link
Author

Sorry I did not follow up on this. I ended up just using the scale-offset filter in combination with standard gzip compression to reduce the data size. I didn't try to use any other lossy compression method, but it worked fine for my needs, though having lossy compression might still be a cool feature.

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