{"library":"node-bitmap","title":"Bitmap Image Library for Node.js","description":"node-bitmap is a pure JavaScript library designed for low-level bitmap image manipulation within Node.js environments. Published over a decade ago as version 0.0.1, this package offers basic functionalities for creating and modifying uncompressed bitmap data, including setting and getting individual pixel values. It was developed to run on very old Node.js versions (>=v0.6.5) and has seen no updates or maintenance since its initial release. Consequently, it is considered abandoned and lacks compatibility with modern JavaScript features, Node.js versions, and security patches. Its primary differentiator was its 'pure JavaScript' implementation, avoiding native dependencies at a time when such libraries often required them, but this also means it is likely slower and less feature-rich than contemporary alternatives.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install node-bitmap"],"cli":null},"imports":["const Bitmap = require('node-bitmap');","const bmp = new Bitmap(width, height);"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const Bitmap = require('node-bitmap');\n\n// Create a new 100x50 pixel bitmap with a default background (often black)\nconst width = 100;\nconst height = 50;\nconst bmp = new Bitmap(width, height);\n\n// Set a pixel at (10, 20) to red (RGBA)\nbmp.setPixel(10, 20, 255, 0, 0, 255);\n\n// Get the pixel data at (10, 20)\nconst pixel = bmp.getPixel(10, 20);\nconsole.log(`Pixel at (10, 20): R=${pixel.r}, G=${pixel.g}, B=${pixel.b}, A=${pixel.a}`);\n\n// Fill a small square with blue\nfor (let y = 5; y < 15; y++) {\n  for (let x = 5; x < 15; x++) {\n    bmp.setPixel(x, y, 0, 0, 255, 255);\n  }\n}\n\n// In a real application, you would then convert this bitmap to a buffer\n// for saving to a file or sending over a network, e.g., bmp.toBuffer();\n// (Note: The `toBuffer` method might not be directly available or might need\n// specific arguments; this quickstart focuses on pixel manipulation.)\nconsole.log(`Created a ${width}x${height} bitmap and manipulated pixels.`);\n// Example of accessing raw buffer (highly dependent on implementation)\n// console.log('Bitmap raw buffer size:', bmp.buffer.length);\n","lang":"javascript","description":"Demonstrates how to initialize a new bitmap, set individual pixel colors, and retrieve pixel data using the CommonJS `require` syntax.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}