Skip to content

Loading images as contiguous memory #1258

Answered by antonfirsov
ThomasMiz asked this question in Q&A
Discussion options

You must be logged in to vote

Discontiguous buffers have been introduced in #1109 to enable handling very large images. The size of a single contiguous buffer is limited by ArrayPoolMemoryAllocator.BufferCapacityInBytes. It's current (arbitrary) default value is int.MaxValue/4 which means that an Image<Rgba32> below the size of ~134 megapixels (~ 12k x 11k pixels) will always fit into a single buffer with the default setup. However, we may decide to lower this value, so if you want to make sure your images fit into a single buffer, I'd suggest to create a custom ArrayPoolMemoryAllocator instance, and assign it to Configuration.Default.MemoryAllocator (or to the same property on your custom Configuration instance).

Unf…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ThomasMiz
Comment options

@antonfirsov
Comment options

@ThomasMiz
Comment options

Answer selected by ThomasMiz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants