{"_id":"@rgba-image/create-image","_rev":"3-f63b74279380a2bcdb2c2f73d8e112dc","name":"@rgba-image/create-image","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@rgba-image/create-image","version":"0.1.0","description":"Create an RGBA image compatible with ImageData","main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"tsc","test":"tsc && mocha ./dist/test","coverage":"tsc && nyc --reporter=html --reporter=text mocha ./dist/test"},"nyc":{"exclude":["./dist/test"]},"repository":{"type":"git","url":"git+https://github.com/rgba-image/create-image.git"},"keywords":[],"author":{"name":"Nik Coughlin","email":"nrkn.com@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/rgba-image/create-image/issues"},"homepage":"https://github.com/rgba-image/create-image#readme","devDependencies":{"@types/mocha":"^5.2.5","@types/node":"^10.12.1"},"gitHead":"d34d1e3c2161e075a4705791c564bda26ff3d7e6","_id":"@rgba-image/create-image@0.1.0","_npmVersion":"6.0.1","_nodeVersion":"10.11.0","_npmUser":{"name":"nrkn","email":"nrkn.com@gmail.com"},"dist":{"integrity":"sha512-apN+nZ8LO3o7T/YmbdZJ82rwQ+j+AYjmGG4ysxvhMACj+aoD2qFBrvuTtoA+0PWpPc/y/RHlnp9VtIi/QAMOyA==","shasum":"003027c0a709059ee3008c174b847310f197331d","tarball":"https://registry.npmjs.org/@rgba-image/create-image/-/create-image-0.1.0.tgz","fileCount":13,"unpackedSize":26082,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2PplCRA9TVsSAnZWagAASmgP/RreOmZjd7KG+lcQRFDA\nJ75sxG8T4m9HxdDJFuB2VicxB01DJVhEBb3+U/TTIZ4GE/mp0s3xZCFSk4YM\nQB7Gcqd487q7o+ZkJBtq41ebrB0YYgCcyoSA5D5SkSn5YsXxN1Dr6OgSPM3c\nqVve4aTwJzDx3BXLUo4DWxpUMnb4qUcS2Nw9ax0wqUmpGlSFDAyf7Te09laU\nkK7deacQhqbvQO4Lry110LVz5cKcMWCAG+DTKbOCoCnFZFGrG/X383KmoCrN\n4t/MceYB2XlIZ9Uh+isy51WKE3jcAUSiiz/vkZ1GDpRwxGGxInKj7vax6aa+\n979oQjgzQ7qoQI+nFuN3YT0A/RmvdrexXt4scVMCHxiu77ZBbF0uy6WjUCZe\ng4ip+cbdokBNYQfdIaeFO6AgjXOwzTA/gx4TlwsSDSAi8oPKLJVD+7p7saXX\nU/3T+6yALFkH8R9ifCLAVB4VQTeUOq5mGSOkuihp9Y3GTAlv7omVmq+ltrKj\nRD+Sw4vPk02LBKlOSdjeyqnmQav6i69/IBft5wKM4NkGgus+cVo0lNxIUWSz\nNzZOB15sXIMhCwFx88AWVrlPQ4DYPsP8G0yXll+p90eEzSl9H2WCMGoVkZMr\nWG0f2VWPfBRdV4sGWgJFpw+6ChQz7yhRjMnz0dzHP1EXRjQme0lLTH7/qvml\nZDUq\r\n=y56+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwRdgCvUwgGyHWUBW9UVHetilGlORGKaJ14/xyle/WcAIgNTIQf1ECoLOh18hDmpIDqwjOtHudzvQhnFlq8VnzhtI="}]},"maintainers":[{"name":"nrkn","email":"nrkn.com@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/create-image_0.1.0_1540946532349_0.13014450219477558"},"_hasShrinkwrap":false},"0.1.1":{"name":"@rgba-image/create-image","version":"0.1.1","description":"Create an RGBA image compatible with ImageData","main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"tsc","test":"tsc && mocha ./dist/test","coverage":"tsc && nyc --reporter=html --reporter=text mocha ./dist/test"},"nyc":{"exclude":["./dist/test"]},"repository":{"type":"git","url":"git+https://github.com/rgba-image/create-image.git"},"keywords":[],"author":{"name":"Nik Coughlin","email":"nrkn.com@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/rgba-image/create-image/issues"},"homepage":"https://github.com/rgba-image/create-image#readme","dependencies":{"@rgba-image/common":"^0.1.0"},"devDependencies":{"@types/mocha":"^5.2.5","@types/node":"^10.12.1"},"gitHead":"110a8facb8aa30112bf865c226fd59a7a8081ca7","_id":"@rgba-image/create-image@0.1.1","_npmVersion":"6.0.1","_nodeVersion":"10.11.0","_npmUser":{"name":"nrkn","email":"nrkn.com@gmail.com"},"dist":{"integrity":"sha512-ndExUNyi9Ooa/OZqiJS53vYrQ48FX7MDmMrEslDxhsorDsXpeKI9w689r4AYhT9CF9KZlBe8SmI++3BwSvvwAQ==","shasum":"873ee0ffa2d1a62565845874a7a83c4e53ae1851","tarball":"https://registry.npmjs.org/@rgba-image/create-image/-/create-image-0.1.1.tgz","fileCount":13,"unpackedSize":26155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb2Qp3CRA9TVsSAnZWagAA8C4P/2NUyIce8s8a0EIGXiw3\nGk0quJcBooZgmmEQA4vRYh6qlVZeOOqKZNqno6Il5ed98gtY126vhD9X/D3I\nKEhm9fZ/nRMCTNRzdfSkzkAIwOOOKnqAKczFrH4YINSK+U14zV5ZzMGKMIAD\nOQ+QGK3wp/XMZmSbYNrRGQbeeaqukoE9wGlFO8CUA24bIavg+m0+Uvvc6GcF\neK9o2oXTxmSZwSQo9dOSPYS9kKKa7cl3zz0egkEP8R59wTsBrwpoy419TFaF\n0qg0Bw5eg6U97Xu1lRKWUYRyQ/gcUfnjzcFByKNULe6dK60wmNguYLC21cOT\nt/KuUfB8HP8dbVhD86Bt3KqabRQP8dwZCSLkQ68GbrADwyTDcGvPl6LEkfIg\nocW0ia8cYAysS0se02T1TNBdkEFVoCBFOJJzJEyWHFr5XaHt7KkVaoRixk24\nxyChVSBWpalwOVJa2xUZ0ik5VHVadramXJ/8xgp8Z0lAfmRn2+TXdU7+O7kQ\nD+1NQDpf7j5jJ8VS1A2bRCgWOhgqMPFW8wvCxc/gqZhiyTx1SSedumqlwtLk\nOURToI3gkisg32rzeXJxz8E2D4+SRyPFSRdx6wHmATenvz50mqTVA2rZ7/Lb\n3PzdtDLnyCckQLdP8DxFqqkj6TKPYYyFKQTJWIyz4DxUwKJ7t0pMj49hCyiC\nqL32\r\n=E0fM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCyWfZS7bduzdw6hIUooZvtHm3GRsag7+A4QQsaK0X2YQIgNPsbhFGIaWCwno70rct/KJuRvnJYSaXMGgcYPg5TzZc="}]},"maintainers":[{"name":"nrkn","email":"nrkn.com@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/create-image_0.1.1_1540950646633_0.1953660988463619"},"_hasShrinkwrap":false},"0.2.0":{"name":"@rgba-image/create-image","version":"0.2.0","description":"Create an RGBA image compatible with ImageData","main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"tsc","test":"tsc && mocha ./dist/test","coverage":"tsc && nyc --reporter=html --reporter=text mocha ./dist/test"},"nyc":{"exclude":["./dist/test"]},"repository":{"type":"git","url":"git+https://github.com/rgba-image/create-image.git"},"keywords":[],"author":{"name":"Nik Coughlin","email":"nrkn.com@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/rgba-image/create-image/issues"},"homepage":"https://github.com/rgba-image/create-image#readme","dependencies":{"@rgba-image/common":"^0.1.13"},"devDependencies":{"@types/mocha":"^9.0.0","@types/node":"^16.6.1"},"gitHead":"6f0fe8f443fcfee8cd60e31ef3426af6291ffbee","_id":"@rgba-image/create-image@0.2.0","_nodeVersion":"14.17.0","_npmVersion":"7.18.1","dist":{"integrity":"sha512-NX7ZGFxvRIEqmTBiwoHQxRHv/Evq2RUjbI+4kuEnFhIsFmr7v7QDzt2n1qulcTAkBudx6m6H5OycRKFsEx+s4g==","shasum":"a7c7e735d68488de9ce161f19c6e580512a8064e","tarball":"https://registry.npmjs.org/@rgba-image/create-image/-/create-image-0.2.0.tgz","fileCount":13,"unpackedSize":28013,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHGK5CRA9TVsSAnZWagAA3mYP/RojbHNIDeAxIxVLv85k\nv4auVtfUyBgvdK7Licgcg5MwEc7p4zCGnM3+/J29o/gguOgM83cbPZKjkFRS\nbFT/bNVsFRBtQ5ZDB02J6a6p0IdAy5EdhUEwVXCLsy/nNgampA61gw0zD5P/\na8oaNDkPrquU0WdbSQBaeVPrjLkKK3ip2de/N40TKE5DEQrS0vxsKRc6J8+t\ngBWsHdkGuNsL1EgQ6r61/42jZaWwhOw6JJxZZXD46fvER3CMMoC3Ql/aNvDY\nU6BUPmdaXbi7+X2GVmAxojH/3A9Hcgll5QjK0iTqdFsvp7R9gs7UyAr26hYz\nI+2YM1qW3C5odMSqnTLFhkb4S9DZvsIjbF7bsGfwEswUmCWorILc6yYJiAEY\nWp1H/t99K/KkKgR1xiX+gInhKQQX+RjVPdiJRX3CmsHBlB19i9StPLdVZ8Vk\nn7roA2sCp/OJqAsRVueQxVv1briRLXBTqCTdawukq/pQJ6FQftZznjSPJMmO\nBMCyG/D6+ElwlCCtGoQEymk3EHAV/i17L4x920iUvr8Ofu+cPCxLdndDpo8O\nmFlgZ/iudl88pgGId+5cPBCOIsAFWB7CoRqgPbdYpcYf1bVSHI77XY+LNSDO\nTg/zH772YMoznirpPOEjzklqGHuwawevJpXkRZz/6uF4S6R4f3huX7O1DblR\nvKJP\r\n=bb2w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH3f4Tsmvjq+q2Zq8UrHKz6KG3OLXaAwRqbYtuF4ZIr5AiAbmskhTONfgCTiiSzCQIb9Ah6iJHG0O/JnUwN/cFcBdg=="}]},"_npmUser":{"name":"nrkn","email":"nrkn.com@gmail.com"},"directories":{},"maintainers":[{"name":"nrkn","email":"nrkn.com@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/create-image_0.2.0_1629250233378_0.9354882327654208"},"_hasShrinkwrap":false}},"time":{"created":"2018-10-31T00:42:12.199Z","0.1.0":"2018-10-31T00:42:12.580Z","modified":"2022-04-06T19:46:33.968Z","0.1.1":"2018-10-31T01:50:46.801Z","0.2.0":"2021-08-18T01:30:33.641Z"},"maintainers":[{"name":"nrkn","email":"nrkn.com@gmail.com"}],"description":"Create an RGBA image compatible with ImageData","homepage":"https://github.com/rgba-image/create-image#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/rgba-image/create-image.git"},"author":{"name":"Nik Coughlin","email":"nrkn.com@gmail.com"},"bugs":{"url":"https://github.com/rgba-image/create-image/issues"},"license":"MIT","readme":"# create-image\r\n\r\nCreate an RGBA image compatible with the \r\n[ImageData](https://developer.mozilla.org/en-US/docs/Web/API/ImageData) Web API \r\ninterface\r\n\r\nThe image will be filled with transparent black - `[ 0, 0, 0, 0 ]`\r\n\r\nAll fields are readonly:\r\n\r\n```typescript\r\n{\r\n  width: number\r\n  height: number\r\n  data: Uint8ClampedArray\r\n}\r\n```\r\n\r\nIf the ImageData constructor is found in the global object, eg in the browser \r\nor with a patched global in node, it will return an instance of that \r\nconstructor, otherwise it will return a plain javascript object\r\n\r\n## install\r\n\r\n`npm install @rgba-image/create-image`\r\n\r\n## usage\r\n\r\n```js\r\nconst { createImage } = require( '@rgba-image/create-image' )\r\n\r\nconst imageData = createImage( 300, 150 )\r\n```\r\n\r\nPopulate from an existing `Uint8ClampedArray` (must be `width * height * 4` in length):\r\n\r\n```js\r\nconst imageData = createImage( 300, 150, data )\r\n```\r\n\r\nThis module also provides `CreateImageFactory`, so you can create a\r\n`createImage` function which fills the initial data with a different color, eg\r\nto emulate ImageData in the browser, which fills the image with opaque black:\r\n\r\n```js\r\nconst { CreateImageFactory } = require( '@rgba-image/create-image' )\r\n\r\nconst createImage = CreateImageFactory( [ 0, 0, 0, 255 ] )\r\n\r\nconst imageData = createImage( 300, 150 )\r\n```\r\n\r\nYou can also create images with a different number of channels, but these will\r\nnot be compatible with other modules in `rgba-image`:\r\n\r\n```js\r\nconst { CreateImageFactory } = require( '@rgba-image/create-image' )\r\n\r\nconst rgbChannels = 3\r\n\r\nconst createRgbImage = CreateImageFactory( [ 0, 0, 0 ], rgbChannels )\r\n\r\nconst imageData = createImage( 300, 150 )\r\n```\r\n\r\n## license\r\n\r\nMIT License\r\n\r\nCopyright (c) 2021 Nik Coughlin\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.\r\n","readmeFilename":"README.md"}