diff --git a/examples/test/bg.js b/examples/test/bg.js new file mode 100644 index 0000000..a38985c --- /dev/null +++ b/examples/test/bg.js @@ -0,0 +1,28 @@ +#!/usr/bin/env node + +var fs = require('fs'), + PNG = require('pngjs').PNG; + + +var png = new PNG({ + width: 10, + height: 10, + filterType: -1 +}); + + +for (var y = 0; y < png.height; y++) { + for (var x = 0; x < png.width; x++) { + var idx = (png.width * y + x) << 2; + + var col = x < (png.width >> 1) ^ y < (png.height >> 1) ? 0xe5 : 0xff; + + png.data[idx ] = col; + png.data[idx+1] = col; + png.data[idx+2] = col; + png.data[idx+3] = 0xff; + } +} + +png.pipe(fs.createWriteStream('bg.png')); +png.pack(); diff --git a/examples/test/bg.png b/examples/test/bg.png new file mode 100644 index 0000000..491ae6e Binary files /dev/null and b/examples/test/bg.png differ diff --git a/examples/test/list.html b/examples/test/list.html index 1e3aa12..b2183fd 100644 --- a/examples/test/list.html +++ b/examples/test/list.html @@ -3,8 +3,8 @@