# Special-purpose noise function

This topic is 5220 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Aight. So what I need to implement is a discrete 2D noise function. It can have a normal distribution, a flat distribution, whatever. But what I really need is for the mean value within all circles of a particular size (say, a 5-pixel radius or so) to get as close to the mean for the entire function as possible. That is, there can't be any clumps of white pixels. I've thought about ways to accomplish this, and I have some ideas I think are workable, but I'm sure that much smarter people than I have trodden this ground before. So far, googling has not borne fruit; I just don't know what keywords to describe this with. Anyone come across this before?

##### Share on other sites
Doesn't random static fill that requirement? Or have I misunderstood what you're after?

##### Share on other sites
It does, given a large enough radius (central limit theorem), but I need this property for relatively small radii.

##### Share on other sites
I'm not an expert, here is my suggestion: run it through a high-pass filter. That should remove all the clumps. The cutoff frequency would be 1/diameter.

##### Share on other sites
I would suggest random differences from the pixel next to it, although I don't know whether the whole thing would have a good distribution

##### Share on other sites
hmm. Something like this perhaps?

for each pixel{   do   {     n = rand();   } until (n != any of the 8 neighbors);   pixel = n;}

Too complicated? Slow?

1. 1
2. 2
Rutin
19
3. 3
khawk
18
4. 4
5. 5
A4L
11

• 12
• 16
• 26
• 10
• 44
• ### Forum Statistics

• Total Topics
633767
• Total Posts
3013739
×