Skip to content

Commit

Permalink
added more visible sections to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
pkrumins committed Jul 3, 2010
1 parent 7f515bd commit f1944e0
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion readme.txt
Expand Up @@ -16,6 +16,9 @@ space efficient way (so that the canvas border matches the leftmost upper corner
of some PNG and the rightmost bottom corner of some PNG).


Png
---

The `Png` object takes 3 arguments in its constructor:

var png = new Png(buffer, width, height);
Expand All @@ -34,6 +37,9 @@ You can now either send the png_image to the browser, or write to a file, or
do something else with it. See `examples/` directory for more examples.


FixedPngStack
-------------

The `FixedPngStack` object takes two arguments in its constructor:

var fixed_png = new FixedPngStack(width, height);
Expand All @@ -54,6 +60,9 @@ buffers together and return a single PNG.
All the regions that did not get covered will be transparent.


DynamicPngStack
---------------

The `DynamicPngStack` object doesn't take any arguments because its width and
height is dynamically computed. To create it, do:

Expand Down Expand Up @@ -98,6 +107,10 @@ The height `dims.height` is 220 because the 2nd png is located at 210 and
its height is 20, so it stretches to position 230, but the first png starts
at 10, so the upper 10 pixels are not necessary and height becomes 230-10= 220.


How to compile?
---------------

To get the node-png module compiled, you need to have libpng and node.js
installed. Then just run:

Expand All @@ -112,7 +125,6 @@ If you wish to stream PNGs over a websocket or xhr-multipart, you'll have to
base64 encode it. Use my http://github.com/pkrumins/node-base64 module to do
that.


------------------------------------------------------------------------------

Have fun producing PNGs!
Expand Down

0 comments on commit f1944e0

Please sign in to comment.