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

Generate noise as a dynamic background view in iOS #20

Open
martindufort opened this issue Jun 8, 2024 · 2 comments
Open

Generate noise as a dynamic background view in iOS #20

martindufort opened this issue Jun 8, 2024 · 2 comments

Comments

@martindufort
Copy link

This is really not an issue but mostly an interrogation on my part.
I was wondering if I could generate dynamic noise background patterns and include them in my iOS app.

Questions:

  1. Would that be feasible as far as rendering time?
  2. Can I leverage the png creation capability of the tests and display the generated image directly in a view?
  3. Would it be possible to seed the noise generator to support a light and dark pattern to follow the iOS app environment (light or dark)?

Thanks

@tayloraswift
Copy link
Owner

  1. i don't know if the library can generate noise animations in real time, but one thing you could do is bake an animation of the noise to run in a loop. to make it seamless, i suggest sampling one of the three-dimensional noises in a ring-like motion. you’d have to implement a little bit of geometric math for that though.

  2. you could certainly use PNG, but i’m not an iOS expert and there might be a better file format for this.

  3. what i would recommend is to generate primary color channels, and then map each of those channels to a light or dark hue to customize the appearance.

@martindufort
Copy link
Author

Thanks a bunch for this. I was unclear in my previous message but my initial goal was to display a single generated noise image as a background view.

However I will surely rethink this and possibly have some subtle motion / animations between various images.

Will play around with this and report back if I get stuck. Thanks.

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

2 participants