[![Github Link][github badge]][github link]
[![CI Status][ci badge]][ci link]
[![Documentation][docs badge]][docs link]
[![Version][crates.io version]][crates.io link]
Noise-rs
Procedural Noise Generation library for Rust
Explore the docs »
Report Bug -
Request Feature
```toml
[dependencies]
noise = "0.9"
```
## About The Project
Noise-rs is a Rust library to generate smoothly varying noise for textural use and graphical display.
Noise generators are contained in `NoiseFn` modules, and can be combined to make very complex noise results.
### Planetary Surface Example
![planet surface image]
![planet surface 4x]
![planet surface 16x]
### Gradient Noise
Gradient noise produces a smooth, continuous value over space. It's achieved by
dividing space into regions, placing a random gradient at each vertex, and then
blending between those gradients.
#### Noise Functions
These are the actual noise functions, which just take a coordinate using `get()` and return
a value. They can be chained together when declared, creating very complex noise results.
See the individual function pages for their descriptions, and the [examples][examples link] for their usage.
## Usage
To use the function `write_to_file` you have to set the feature `"images"` in the `Cargo.toml`
```toml
[dependencies]
noise = { version = "0.9.0", features = ["images"] }
```
```rust
use noise::{Fbm, Perlin};
use noise::utils::{NoiseMapBuilder, PlaneMapBuilder};
fn main() {
let fbm = Fbm::::new(0);
PlaneMapBuilder::<_, 2>::new(&fbm)
.set_size(1000, 1000)
.set_x_bounds(-5.0, 5.0)
.set_y_bounds(-5.0, 5.0)
.build()
.write_to_file("fbm.png");
}
```
![FBM Noise][fbm image]
_For more examples, refer to the [Examples][examples link]_
## Roadmap
See the [open issues][issues link] for a list of proposed features (and known issues).
## Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any
contributions you make are **greatly appreciated**.
1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you shall be dual licensed as below, without any
additional terms or conditions.
## License
Licensed under either of
* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.
## Contact
Project Link: [https://github.com/razaekel/noise-rs][github link]
[ci link]: https://github.com/razaekel/noise-rs/actions
[ci badge]: https://img.shields.io/github/actions/workflow/status/razaekel/noise-rs/rust.yml?style=for-the-badge&logo=github-actions&logoColor=white
[crates.io link]: https://crates.io/crates/noise
[crates.io version]: https://img.shields.io/crates/v/noise.svg?style=for-the-badge&logo=rust
[docs link]: https://docs.rs/noise
[docs badge]: https://img.shields.io/badge/docs-online-5023dd.svg?style=for-the-badge&logoColor=white&logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K
[examples link]: /examples/
[fbm image]: /images/fbm.png
[github badge]: https://img.shields.io/badge/github-razaekel/noise--rs-8da0cb?style=for-the-badge&logo=github
[github link]: https://github.com/razaekel/noise-rs
[issues link]: https://github.com/razaekel/noise-rs/issues
[planet surface image]: /images/unscaledFinalPlanet.png
[planet surface 4x]: /images/unscaledFinalPlanet_4x_zoom.png
[planet surface 16x]: /images/unscaledFinalPlanet_16x_zoom.png