索引颜色PNG图像生成器。
Indexed color PNG image generator.
pzntg.create(options) → String (base64) | Uint8Array
Supported options:
If callback is not defined, value is returned.
Read this for more information about zlib options.
pzntg.create({
pixels: [
[0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0],
[0,0,0,0,0,0,1,1,1,0,0,0,1,1,1,1,1,0,0,0,1,1,1,0,0,0,0,0,0],
[0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0],
[0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0],
[0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0],
[0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0],
[0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0],
[0,0,0,0,0,1,1,1,1,2,2,2,2,1,1,1,2,2,2,2,1,1,1,1,0,0,0,0,0],
[0,0,0,0,0,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,0,0,0,0,0],
[0,0,0,0,0,1,1,2,2,2,4,2,2,2,2,2,2,2,4,2,2,2,1,1,0,0,0,0,0],
[0,5,5,5,5,1,1,2,2,4,3,4,2,2,2,2,2,4,3,4,2,2,1,1,5,5,5,5,0],
[0,0,0,0,0,1,1,2,2,4,3,4,2,2,2,2,2,4,3,4,2,2,1,1,0,0,0,0,0],
[0,5,5,5,5,1,1,2,2,2,4,2,2,2,3,2,2,2,4,2,2,2,1,1,5,5,5,5,0],
[0,0,0,0,0,0,1,1,1,2,2,2,2,2,2,2,2,2,2,2,1,1,1,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,1,1,2,2,2,3,3,3,2,2,2,1,1,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,1,1,1,1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