Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Random Pictures Using .pngs ... how?by FoxtrotUniform (Prior) |
on Aug 21, 2001 at 21:13 UTC ( [id://106647]=note: print w/replies, xml ) | Need Help?? |
Since other people have talked about the mechanics of writing PNGs with perl, I figured I'd talk about the random-pixels bit (since that's fairly close to my area of specialization). If all you want is random, unrelated pixels, that's easy enough to do, but you'll probably want some way of restricting their intensity and color (to make it easy to generate a bunch of pixels that are all mostly red and fairly dark, for instance -- in my experience, once you have a random image generator with a bunch of knobs and widgets, you spend hours playing with it :-). You might also want to be able to set "gain" on the data -- higher gain would mean more pixels at high and low intensities, lower gain would mean most of the pixels end up at moderate intensities. A more interesting (to me) kind of random image data is Perlin (or coherent) noise. Well-implemented Perlin noise has a bunch of cool statistical properties, but at a glance it's just smooth noise. I'd rant about all the cool things you can do with it, but I have deadlines to attend to, so I'll leave you with a url: this page, by Hugo Elias. If you're really interested in this stuff, the canonical reference is Texturing and Modeling: A Procedural Approach, which is damn good. --:wq
In Section
Seekers of Perl Wisdom
|
|