Skip to content

Reduce resolution of image in 2d array #1325

Closed Answered by nilgoyette
Isaac-Leonard asked this question in Q&A
Discussion options

You must be logged in to vote

I can't remember where this is written, but you should use iter/into_iter as less as possible because it is slow. For example, what you wrote can be expressed as

Zip::indexed(&data).for_each(|idx, &pixel| {
    if idx == (0, 0) { wathever }
})

If you're starting with ndarray, I strongly suggest you to read the quickstart and official doc.

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@nilgoyette
Comment options

Answer selected by Isaac-Leonard
Comment options

You must be logged in to vote
0 replies
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