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 reply to Re: Random Pictures Using .pngs ... how? by FoxtrotUniform
in thread Random Pictures Using .pngs ... how? by bladx

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.