{"_id":"@airplanegobrr/pixelencode","name":"@airplanegobrr/pixelencode","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@airplanegobrr/pixelencode","version":"1.0.0","description":"Encode data into a picture!","main":"src/index.js","keywords":[],"author":{"name":"AirplaneGobrr","email":"airplane@airplanegobrr.xyz","url":"https://airplanegobrr.xyz"},"license":"ISC","dependencies":{"sharp":"^0.33.5"},"scripts":{"test":"node test/test.js"},"_id":"@airplanegobrr/pixelencode@1.0.0","_integrity":"sha512-JqX26TRLzeDJtYz4YtBi7Azil+S8/zY5NHqsv7XKA3cpgwzgsKK//AkOSXCEwZ6O4VqJo7nrRf4BxaBgU5tXuA==","_resolved":"C:\\Users\\AIRPLA~1\\AppData\\Local\\Temp\\4a3546bcb8ae799172b4d5922e84c194\\airplanegobrr-pixelencode-1.0.0.tgz","_from":"file:airplanegobrr-pixelencode-1.0.0.tgz","_nodeVersion":"20.18.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-JqX26TRLzeDJtYz4YtBi7Azil+S8/zY5NHqsv7XKA3cpgwzgsKK//AkOSXCEwZ6O4VqJo7nrRf4BxaBgU5tXuA==","shasum":"b6cb682a6d30b7dd9f7b0998c3d88be33d5ac332","tarball":"https://registry.npmjs.org/@airplanegobrr/pixelencode/-/pixelencode-1.0.0.tgz","fileCount":4,"unpackedSize":12234,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAf+z2p0vFf6TVVwpqCqGYx5SEESmQLoSsME8P+0z2dfAiEAjCBu+Q/WA6MZQe14lERV6VtE7kjwxoXDXSIxaTR44s0="}]},"_npmUser":{"name":"airplanegobrr","email":"airplanegobrrfeedback@gmail.com"},"directories":{},"maintainers":[{"name":"airplanegobrr","email":"airplanegobrrfeedback@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pixelencode_1.0.0_1737499500870_0.7145669840615398"},"_hasShrinkwrap":false}},"time":{"created":"2025-01-21T22:45:00.742Z","1.0.0":"2025-01-21T22:45:01.027Z","modified":"2025-01-21T22:45:01.357Z"},"maintainers":[{"name":"airplanegobrr","email":"airplanegobrrfeedback@gmail.com"}],"description":"Encode data into a picture!","keywords":[],"author":{"name":"AirplaneGobrr","email":"airplane@airplanegobrr.xyz","url":"https://airplanegobrr.xyz"},"license":"ISC","readme":"# PixelEncode\r\nEncode/decode data into a picture\r\n\r\nSimple project to turn data into a picture!\r\n\r\n# Installing\r\n\r\nInstall via npm:\r\n\r\n```npm install @airplanegobrr/pixelencode```\r\n\r\n# Using\r\n\r\nUsing this is very simple\r\n\r\n```js\r\nconst { PixelEncode } = require(\"@airplanegobrr/pixelencode\")\r\n\r\nlet ed = new PixelEncode()\r\nlet dataToEncode = \"Hello, World!\"\r\n\r\ned.encode(dataToEncode).then(async encodedPicture=>{\r\n    // encodedPicture is a PNG buffer with the data encoded\r\n\r\n    let decoded = await ed.decode(encodedPicture)\r\n    console.log(decoded.toString()) // Output: Hello, World!\r\n})\r\n```\r\n\r\n## Constructor Parameters\r\n\r\nYou can customize the `PixelEncode` class by passing the following parameters:\r\n\r\n```js\r\nlet ed = new PixelEncode(mode, blockSize, maxHSL, width, height);\r\n```\r\n\r\n| Parameter   | Default    | Description |\r\n| ----------- | ---------- | ----------- |\r\n| `Mode`      | \"`base64`\" | Encoding mode: `base64`, `hex`, or `binary`. I would stick to using `base64`. Determines how data is encoded into colors.|\r\n| `blockSize` | `3`        | Size of the blocks. Larger blocks may help with compression but increase output size. |\r\n| `maxHSL`    | `330`      | Upper limit for HSL values. Affects the range of colors used in the picture. |\r\n| `width`     | `3840`     | Width of the output image buffer. |\r\n| `height`    | `2160`     | Height of the output image buffer. |\r\n\r\n## Handling Compression\r\n\r\nWhen uploading output buffers to platforms like `Discord` or `YouTube`, re-downloaded images may be compressed. This compression can distort pixel data, making it impossible to decode the original information.\r\n\r\nThis is a known issue and will be looked into in the future, some stuff is already in to hopeful* help this issue.\r\n\r\nTo make compression less impactful, try to use a different `mode` and a bigger `blockSize`\r\n\r\n# Todo\r\n- [ ] Split large data into many arrays/pictures\r\n- [ ] Better compression reading","readmeFilename":"README.md"}