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

common interface and documentation to support optimized implementation on various image memory formats #180

Open
johnnychen94 opened this issue Apr 17, 2022 · 0 comments

Comments

@johnnychen94
Copy link
Member

johnnychen94 commented Apr 17, 2022

This is a re-post from a recent slack discussion

I don't think JuliaImages will try to break the "an image is AbstractArray{<:Colorant} " contract because we've proved that it's so convenient to build orthogonality and thus support generic codes in a very efficient way. For image data that doesn't fit into the AoS (RGBRGBRGB) memory layout, an approach to fit into the JuliaImages type design is to provide a thin array wrapper for it.

For instance:

  • IndirectArray for indexed image
  • StructArray wraps SoA data as AbstractArray{<:Colorant}
  • SparseArray from SparseArrayKit wraps a dict-based data for sparse image

By following this design, we can ensure that our toolbox at least works for those special image types. And if performance is a concern, we add specialized methods to provide an optimized implementation for them via multiple dispatches.

we need to figure out the missing utilities by adding a few examples, e.g., imresize on the indexed image can be an interesting yet simple example.

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

1 participant