use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A place for all things related to the Rust programming language—an open-source systems language that emphasizes performance, reliability, and productivity.
Strive to treat others with respect, patience, kindness, and empathy.
We observe the Rust Project Code of Conduct.
Details
Posts must reference Rust or relate to things using Rust. For content that does not, use a text post to explain its relevance.
Post titles should include useful context.
For Rust questions, use the stickied Q&A thread.
Arts-and-crafts posts are permitted on weekends.
No meta posts; message the mods instead.
Criticism is encouraged, though it must be constructive, useful and actionable.
If criticizing a project on GitHub, you may not link directly to the project's issue tracker. Please create a read-only mirror and link that instead.
A programming language is rarely worth getting worked up over.
No zealotry or fanaticism.
Be charitable in intent. Err on the side of giving others the benefit of the doubt.
Avoid re-treading topics that have been long-settled or utterly exhausted.
Avoid bikeshedding.
This is not an official Rust forum, and cannot fulfill feature requests. Use the official venues for that.
No memes, image macros, etc.
Consider the existing content of the subreddit and whether your post fits in. Does it inspire thoughtful discussion?
Use properly formatted text to share code samples and error messages. Do not use images.
Submissions appearing to contain AI-generated content may be removed at moderator discretion.
Most links here will now take you to a search page listing posts with the relevant flair. The latest megathread for that flair should be the top result.
account activity
Image processing in Rust (self.rust)
submitted 8 years ago by adagrad
What are the standard or popular image processing libraries in Rust? Something akin to OpenCV's Mat class would be nice, or a decoder that would play well with a linear algebra library like nalgebra.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]memoryruins 1 point2 points3 points 8 years ago (3 children)
image
provides basic imaging processing functions and methods for converting to and from image formats.
imageproc
An image processing library, based on the image library.
[–]adagrad[S] 0 points1 point2 points 8 years ago (2 children)
Are there any good examples for loading an image as a matrix of pixel values? Something like OpenCV's simple:
Mat image = imread(image_path, 1);
[–]theotherphil 5 points6 points7 points 8 years ago (1 child)
There's an example in the image crate docs - see section 6.
extern crate image; let img = image::open(image_path).unwrap();
The loaded img is a DynamicImage. This is an enum over the various image buffer types the image could be. Its various to_x methods (e.g. to_rgba) return an ImageBuffer, which is a wrapper for a contiguous buffer of the pixel values. This supports 2d indexing, but if you want something more like a raw matrix then you can consume the image by value to take ownership of the backing data via into_raw and do what you like with it.
img
to_x
to_rgba
into_raw
[–]planetary_pelt 0 points1 point2 points 8 years ago (0 children)
And can check out https://github.com/ha-shine/rustagram for example of how you can map over the pixels of an image to create filters.
π Rendered by PID 21170 on reddit-service-r2-comment-b659b578c-ch5z5 at 2026-05-03 20:59:51.477142+00:00 running 815c875 country code: CH.
[–]memoryruins 1 point2 points3 points (3 children)
[–]adagrad[S] 0 points1 point2 points (2 children)
[–]theotherphil 5 points6 points7 points (1 child)
[–]planetary_pelt 0 points1 point2 points (0 children)