This is the most basic example of how to use PNGwriter. After you've had a look at this page, see the other examples. Here is the code and the image that is generated.
All functions can take two types of colour coefficients: either ints from 0 to 65535 or a doubles that go from 0.0 to 1.0 (as of version 0.3.2).
The constructor takes as arguments the width and the height (in pixels) of the image, the background colour (limited to a shade of grey, but that is fine since one usually just wants a black or white image to start with), and the filename.
To plot, use the
It takes, as arguments, the horizontal coordinate of the pixel (from 1 to the width),
the vertical coordinate of the pixel (from 1 to the height),
the coefficient of red (a double from 0.0 to 1.0),
the coefficient of green (a double from 0.0 to 1.0)
and the coefficient of blue (a double from 0.0 to 1.0).
© 2002, 2003, 2004, 2005, 2006, 2007 Paul Blackburn