{"versions":{"2.0.0":{"_id":"@jimp/plugin-draw@2.0.0","bugs":{"url":"https://github.com/jimp-dev/jimp/issues"},"dist":{"shasum":"1047d7e896e5dd7475f2f2001db0a394c744d967","tarball":"http://123.232.10.234:8212/nexus/content/repositories/npm-private/@jimp/plugin-draw/-/plugin-draw-2.0.0.tgz","fileCount":90,"integrity":"sha512-GXwQYrHXJhMkGdOXpg3HW5s0FP0CnVi96tdtpOLikMX+LrsQXtdCw+dIfImnVCbQDZYp0+PZwQ/UWJ9vs8G9GQ==","signatures":[{"sig":"MEUCIQD0Os32Wj3KTSpWXm8rxTTI9/pyAGDUu6ehm/JeSu5ACAIgEklzO3zNs+/0Ltmvb9i2rmEVH2JqLM86wXfvs2DGfOs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHMQE7aylO/CFvgDGuhb0bhTQfIa+UB/v4oOPoIGrOwFAiEA4Rc8hPEbMEfsyzNO0nLsOc8G5hLSPqUu6bKW9RPaDjY="}],"unpackedSize":674864,"size":126909},"main":"./dist/commonjs/index.js","name":"@jimp/plugin-draw","tshy":{"exclude":["**/*.test.ts"],"exports":{".":"./src/index.ts","./package.json":"./package.json"}},"type":"module","types":"./dist/commonjs/index.d.ts","author":{"name":"Andrew Lisowski","email":"lisowski54@gmail.com"},"module":"./dist/esm/index.js","engines":{"node":">=22"},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},"./package.json":"./package.json"},"gitHead":"a0c6199088b0a3f28162a1742c9714b285dd194a","license":"MIT","scripts":{"dev":"tshy --watch","lint":"eslint .","test":"vitest","build":"tshy","clean":"rimraf node_modules .tshy .tshy-build dist .turbo","test:browser":"vitest --config vitest.config.browser.mjs"},"version":"2.0.0","_npmUser":{"name":"anonymous","email":"lisowski54@gmail.com"},"homepage":"https://github.com/jimp-dev/jimp#readme","repository":{"url":"git+https://github.com/jimp-dev/jimp.git","type":"git"},"_npmVersion":"lerna/10.1.3/node@v24.15.0+arm64 (darwin)","description":"<div align=\"center\">   <img width=\"200\" height=\"200\"     src=\"https://s3.amazonaws.com/pix.iemoji.com/images/emoji/apple/ios-11/256/crayon.png\">   <h1>@jimp/plugin-draw</h1>   <p>Draw lines, shapes, paths and gradients, and flood fill.</p> </div>","directories":{},"maintainers":[{"name":"anonymous","email":"lisowski54@gmail.com"},{"name":"anonymous","email":"oliver@nth-iteration.ie"}],"sideEffects":false,"_nodeVersion":"24.15.0","dependencies":{"zod":"^4.6.7","@jimp/types":"2.0.0","@jimp/utils":"2.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tshy":"~4.0.0","eslint":"^10.15.0","vitest":"^5.1.1","@jimp/core":"2.0.0","typescript":"^7.0.2","@types/node":"^22.20.5","@jimp/js-png":"2.0.0","@vitest/browser":"^5.1.1","@jimp/test-utils":"2.0.0","@jimp/config-eslint":"2.0.0","@jimp/config-vitest":"2.0.0","@jimp/config-typescript":"2.0.0","vite-plugin-node-polyfills":"^0.28.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-draw_2.0.0_1795496047269_0.911867152034741"},"_cnpmcore_publish_time":"2026-11-24T04:54:07.388Z","publish_time":1795496047388,"_source_registry_name":"default","contributors":[]},"0.0.0-stage":{"name":"@jimp/plugin-draw","version":"0.0.0-stage","_id":"@jimp/plugin-draw@0.0.0-stage","stub":true,"maintainers":[{"name":"anonymous","email":"lisowski54@gmail.com"}],"dist":{"shasum":"dd7590cafb0b66c508c9d52b04043c451df37b74","tarball":"http://123.232.10.234:8212/nexus/content/repositories/npm-private/@jimp/plugin-draw/-/plugin-draw-0.0.0-stage.tgz","fileCount":2,"integrity":"sha512-CPmQvnA+ufHGPjmoGLwV9B9MWxTC+dKjZVYJ0pGuIpN+CY0vCLsu0IBQrsRGVYPLvihIdNlPM+CDEeGH6eAaRg==","signatures":[{"sig":"MEUCIQDvN+aXYDK7Qti4G4munzIw+ATVGqNgsTViYfOWFxExoAIgCYEStrxV6TzgXPOeM+I7xjqeh4B8NXxLxRjAewk1GiA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":339,"size":370},"_npmUser":{"name":"anonymous","email":"lisowski54@gmail.com"},"description":"Temporary package placeholder for staged publishing","directories":{},"_cnpmcore_publish_time":"2026-11-24T04:51:28.459Z","publish_time":1795495888459,"_hasShrinkwrap":false,"_source_registry_name":"default","contributors":[]},"2.1.0":{"_id":"@jimp/plugin-draw@2.1.0","bugs":{"url":"https://github.com/jimp-dev/jimp/issues"},"dist":{"shasum":"6cfb8153f1e66b4bac20f29a8213d1625121e361","tarball":"http://123.232.10.234:8212/nexus/content/repositories/npm-private/@jimp/plugin-draw/-/plugin-draw-2.1.0.tgz","fileCount":90,"integrity":"sha512-+mfO7m5GNWjvVRK/X2CLxuh855u7KxGuMK3INC6NL5WWGsBAuKdSblvSqM4emBP2dfIkglpgYc7hnz66mLn0Gg==","signatures":[{"sig":"MEUCIQDG51aFR3uoT8xhlxixl75z+fWeV7m91ccmYh0niPIO4wIgMCz9C3yqLJbA2SuWnJmk17jyQUNRtwhm47lf5ShLYHA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGwFGtV8DKYgu/0C1uzYG5wTeVYj1GqtVp4GGqkI5tETAiAvDMy53Vio1Za4c205CU/JckO5Y/YwtIDjyDq3mkgc9Q=="}],"unpackedSize":675174,"size":126950},"main":"./dist/commonjs/index.js","name":"@jimp/plugin-draw","tshy":{"exclude":["**/*.test.ts"],"exports":{".":"./src/index.ts","./package.json":"./package.json"}},"type":"module","types":"./dist/commonjs/index.d.ts","author":{"name":"Andrew Lisowski","email":"lisowski54@gmail.com"},"module":"./dist/esm/index.js","engines":{"node":">=22"},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},"./package.json":"./package.json"},"gitHead":"8346e2329163e0c3ee26aaf8fe1001bac8b25a21","license":"MIT","scripts":{"dev":"tshy --watch","lint":"eslint .","test":"vitest","build":"tshy","clean":"rimraf node_modules .tshy .tshy-build dist .turbo","test:browser":"vitest --config vitest.config.browser.mjs"},"version":"2.1.0","_npmUser":{"name":"anonymous","email":"lisowski54@gmail.com"},"homepage":"https://github.com/jimp-dev/jimp#readme","repository":{"url":"git+https://github.com/jimp-dev/jimp.git","type":"git"},"_npmVersion":"lerna/10.1.3/node@v24.15.0+arm64 (darwin)","description":"<div align=\"center\">   <img width=\"140\" alt=\"\"     src=\"https://raw.githubusercontent.com/jimp-dev/jimp/main/.github/assets/jimpy.png\">   <h1>@jimp/plugin-draw</h1>   <p>Draw lines, shapes, paths and gradients, and flood fill.</p> </div>","directories":{},"maintainers":[{"name":"anonymous","email":"lisowski54@gmail.com"},{"name":"anonymous","email":"oliver@nth-iteration.ie"}],"sideEffects":false,"_nodeVersion":"24.15.0","dependencies":{"zod":"^4.6.7","@jimp/types":"2.1.0","@jimp/utils":"2.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tshy":"~4.0.0","eslint":"^10.15.0","vitest":"^5.1.1","@jimp/core":"2.1.0","typescript":"^7.0.2","@types/node":"^22.20.5","@jimp/js-png":"2.1.0","@vitest/browser":"^5.1.1","@jimp/test-utils":"2.1.0","@jimp/config-eslint":"2.1.0","@jimp/config-vitest":"2.1.0","@jimp/config-typescript":"2.1.0","vite-plugin-node-polyfills":"^0.28.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-draw_2.1.0_1795562610142_0.6288096840616529"},"_cnpmcore_publish_time":"2026-11-24T23:23:30.256Z","publish_time":1795562610256,"_source_registry_name":"default","contributors":[]},"2.2.0":{"_id":"@jimp/plugin-draw@2.2.0","bugs":{"url":"https://github.com/jimp-dev/jimp/issues"},"dist":{"shasum":"6f25dbe3db7f621059d32e2d2d58dbb0ace0acef","tarball":"http://123.232.10.234:8212/nexus/content/repositories/npm-private/@jimp/plugin-draw/-/plugin-draw-2.2.0.tgz","fileCount":90,"integrity":"sha512-JW5UQvmNL65UtvxW6bGDNyp4i9hBTMWs7SoKYyVRq/wJUZlTMhRVS1MXQTNT6N3wSYz4BtO+jMa3yh9lH8fE/Q==","signatures":[{"sig":"MEUCIBftA6H+6DqhVSRbdbtYntQ2Fm0dM/plOODfEUY22z2QAiEA7Tl88Oru5oO04vpKu33R5ezK2bbdh+VmIt1JqyNcojw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD+Eb2ZI/kuwCop//uruj5qc2dGPKFtsMqKPu0HZbfzZwIhAOS8EPgcZpOsiVG8fNuFpArS+bCfzAlz0JUbG4xi3R2a"}],"unpackedSize":702618,"size":139022},"main":"./dist/commonjs/index.js","name":"@jimp/plugin-draw","tshy":{"exclude":["**/*.test.ts"],"exports":{".":"./src/index.ts","./package.json":"./package.json"}},"type":"module","types":"./dist/commonjs/index.d.ts","author":{"name":"Andrew Lisowski","email":"lisowski54@gmail.com"},"module":"./dist/esm/index.js","engines":{"node":">=22"},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},"./package.json":"./package.json"},"gitHead":"3308bdef5bcf1a8ef868bd3a5abf5105c993e060","license":"MIT","scripts":{"dev":"tshy --watch","lint":"eslint .","test":"vitest","build":"tshy","clean":"rimraf node_modules .tshy .tshy-build dist .turbo","test:browser":"vitest --config vitest.config.browser.mjs"},"version":"2.2.0","_npmUser":{"name":"anonymous","email":"lisowski54@gmail.com"},"homepage":"https://github.com/jimp-dev/jimp#readme","repository":{"url":"git+https://github.com/jimp-dev/jimp.git","type":"git"},"_npmVersion":"lerna/10.1.3/node@v24.15.0+arm64 (darwin)","description":"<div align=\"center\">   <img width=\"140\" alt=\"\"     src=\"https://raw.githubusercontent.com/jimp-dev/jimp/main/.github/assets/jimpy.png\">   <h1>@jimp/plugin-draw</h1>   <p>Draw lines, shapes, paths and gradients, and flood fill.</p> </div>","directories":{},"maintainers":[{"name":"anonymous","email":"lisowski54@gmail.com"},{"name":"anonymous","email":"oliver@nth-iteration.ie"}],"sideEffects":false,"_nodeVersion":"24.15.0","dependencies":{"zod":"^4.6.7","@jimp/types":"2.2.0","@jimp/utils":"2.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tshy":"~4.0.0","eslint":"^10.15.0","vitest":"^5.1.1","@jimp/core":"2.2.0","typescript":"^7.0.2","@types/node":"^22.20.5","@jimp/js-png":"2.2.0","@vitest/browser":"^5.1.1","@jimp/test-utils":"2.2.0","@jimp/config-eslint":"2.2.0","@jimp/config-vitest":"2.2.0","@jimp/config-typescript":"2.2.0","vite-plugin-node-polyfills":"^0.28.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-draw_2.2.0_1795629236380_0.912669370547649"},"_cnpmcore_publish_time":"2026-11-25T17:53:56.469Z","publish_time":1795629236469,"_source_registry_name":"default","contributors":[]},"2.2.1":{"_id":"@jimp/plugin-draw@2.2.1","bugs":{"url":"https://github.com/jimp-dev/jimp/issues"},"dist":{"shasum":"dcac5affc753c1fb7e44df7917fb64bb79989fb0","tarball":"http://123.232.10.234:8212/nexus/content/repositories/npm-private/@jimp/plugin-draw/-/plugin-draw-2.2.1.tgz","fileCount":90,"integrity":"sha512-poHIOZvxLMH5Nxt4fg1y7kZ2pA+6Tqv5C+YnHeFBXkuSMoryAYWF4Nrohp+cntAmiU73xMrVXNdPZYF6O2exew==","signatures":[{"sig":"MEYCIQCyG6I8CJ8h1khZ8UXnV6Xy8xiVCcvWSojGZMulbnkMeQIhALGnq69Nkh1Lzy0saj8X/HNo4sOJwovgPdqVXWLRCHL6","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDsQ7fn9Kk77qrlUg9RJ2CmOx9x+elm/yPQhhUXi/N2OQIgbMRlljS9qNPpTuujjMovW4skZS323YuCFF0Jv+yuyUg="}],"unpackedSize":702618,"size":139023},"main":"./dist/commonjs/index.js","name":"@jimp/plugin-draw","tshy":{"exclude":["**/*.test.ts"],"exports":{".":"./src/index.ts","./package.json":"./package.json"}},"type":"module","types":"./dist/commonjs/index.d.ts","author":{"name":"Andrew Lisowski","email":"lisowski54@gmail.com"},"module":"./dist/esm/index.js","engines":{"node":">=22"},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},"./package.json":"./package.json"},"gitHead":"7ab3ff96f32a76e547be763bbafd474226429103","license":"MIT","scripts":{"dev":"tshy --watch","lint":"eslint .","test":"vitest","build":"tshy","clean":"rimraf node_modules .tshy .tshy-build dist .turbo","test:browser":"vitest --config vitest.config.browser.mjs"},"version":"2.2.1","_npmUser":{"name":"anonymous","email":"lisowski54@gmail.com"},"homepage":"https://github.com/jimp-dev/jimp#readme","repository":{"url":"git+https://github.com/jimp-dev/jimp.git","type":"git"},"_npmVersion":"lerna/10.1.3/node@v24.15.0+arm64 (darwin)","description":"<div align=\"center\">   <img width=\"140\" alt=\"\"     src=\"https://raw.githubusercontent.com/jimp-dev/jimp/main/.github/assets/jimpy.png\">   <h1>@jimp/plugin-draw</h1>   <p>Draw lines, shapes, paths and gradients, and flood fill.</p> </div>","directories":{},"maintainers":[{"name":"anonymous","email":"lisowski54@gmail.com"},{"name":"anonymous","email":"oliver@nth-iteration.ie"}],"sideEffects":false,"_nodeVersion":"24.15.0","dependencies":{"zod":"^4.6.7","@jimp/types":"2.2.1","@jimp/utils":"2.2.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tshy":"~4.0.0","eslint":"^10.15.0","vitest":"^5.1.1","@jimp/core":"2.2.1","typescript":"^7.0.2","@types/node":"^22.20.5","@jimp/js-png":"2.2.1","@vitest/browser":"^5.1.1","@jimp/test-utils":"2.2.1","@jimp/config-eslint":"2.2.1","@jimp/config-vitest":"2.2.1","@jimp/config-typescript":"2.2.1","vite-plugin-node-polyfills":"^0.28.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-draw_2.2.1_1795814506329_0.41868642224952557"},"_cnpmcore_publish_time":"2026-11-27T21:21:46.436Z","publish_time":1795814506436,"_source_registry_name":"default","contributors":[]},"2.2.2":{"_id":"@jimp/plugin-draw@2.2.2","bugs":{"url":"https://github.com/jimp-dev/jimp/issues"},"dist":{"shasum":"5b326d7d684303c025a2ad91a47e5ab1e3a5ce7b","tarball":"http://123.232.10.234:8212/nexus/content/repositories/npm-private/@jimp/plugin-draw/-/plugin-draw-2.2.2.tgz","fileCount":90,"integrity":"sha512-PehLHrikPDgIMmFFERDJSZShmx3jRpugpw9JXfsdANWMj7CHLHA5vgtvp2EYxlyr7GHPy0UZZ9gkva7nWkQeBg==","signatures":[{"sig":"MEUCIQCEZ2jV+kJ13/18KctzSjzgaOxJ5aTx/Tfo3+pb9/eZmQIgKklQrWXhrTmxmwqo56xot+V43Py/SHMcSCjn2QY+JZs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIG9pBFSke/qr4uH1V7BqIMsNn0fEUjiOOuywSgaHMcB6AiEAxSRx84FMClFrztriwlgI/TtGIxIT9qED6eWkG0sbtjs="}],"unpackedSize":702618,"size":139024},"main":"./dist/commonjs/index.js","name":"@jimp/plugin-draw","tshy":{"exclude":["**/*.test.ts"],"exports":{".":"./src/index.ts","./package.json":"./package.json"}},"type":"module","types":"./dist/commonjs/index.d.ts","author":{"name":"Andrew Lisowski","email":"lisowski54@gmail.com"},"module":"./dist/esm/index.js","engines":{"node":">=22"},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},"./package.json":"./package.json"},"gitHead":"d18cc93e6e0d1765ca72b19c22f2aa94dc183981","license":"MIT","scripts":{"dev":"tshy --watch","lint":"eslint .","test":"vitest","build":"tshy","clean":"rimraf node_modules .tshy .tshy-build dist .turbo","test:browser":"vitest --config vitest.config.browser.mjs"},"version":"2.2.2","_npmUser":{"name":"anonymous","email":"lisowski54@gmail.com"},"homepage":"https://github.com/jimp-dev/jimp#readme","repository":{"url":"git+https://github.com/jimp-dev/jimp.git","type":"git"},"_npmVersion":"lerna/10.1.3/node@v24.15.0+arm64 (darwin)","description":"<div align=\"center\">   <img width=\"140\" alt=\"\"     src=\"https://raw.githubusercontent.com/jimp-dev/jimp/main/.github/assets/jimpy.png\">   <h1>@jimp/plugin-draw</h1>   <p>Draw lines, shapes, paths and gradients, and flood fill.</p> </div>","directories":{},"maintainers":[{"name":"anonymous","email":"lisowski54@gmail.com"},{"name":"anonymous","email":"oliver@nth-iteration.ie"}],"sideEffects":false,"_nodeVersion":"24.15.0","dependencies":{"zod":"^4.6.7","@jimp/types":"2.2.2","@jimp/utils":"2.2.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tshy":"~4.0.0","eslint":"^10.15.0","vitest":"^5.1.1","@jimp/core":"2.2.2","typescript":"^7.0.2","@types/node":"^22.20.5","@jimp/js-png":"2.2.2","@vitest/browser":"^5.1.1","@jimp/test-utils":"2.2.2","@jimp/config-eslint":"2.2.2","@jimp/config-vitest":"2.2.2","@jimp/config-typescript":"2.2.2","vite-plugin-node-polyfills":"^0.28.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-draw_2.2.2_1796011990150_0.5795557476855013"},"_cnpmcore_publish_time":"2026-11-30T04:13:10.246Z","publish_time":1796011990246,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"2.2.2"},"name":"@jimp/plugin-draw","time":{"created":"2026-11-24T04:54:26.184Z","modified":"2026-11-30T04:13:28.771Z","2.0.0":"2026-11-24T04:54:07.388Z","0.0.0-stage":"2026-11-24T04:51:28.459Z","2.1.0":"2026-11-24T23:23:30.256Z","2.2.0":"2026-11-25T17:53:56.469Z","2.2.1":"2026-11-27T21:21:46.436Z","2.2.2":"2026-11-30T04:13:10.246Z"},"readme":"<div align=\"center\">\n  <img width=\"140\" alt=\"\"\n    src=\"https://raw.githubusercontent.com/jimp-dev/jimp/main/.github/assets/jimpy.png\">\n  <h1>@jimp/plugin-draw</h1>\n  <p>Draw lines, shapes, paths and gradients, and flood fill.</p>\n</div>\n\nAntialiased vector drawing, like a small canvas. The plugin is included in `jimp`.\n\n- [drawLine](https://jimp-dev.github.io/jimp/api/jimp/classes/jimp/#drawline)\n- [drawRect](https://jimp-dev.github.io/jimp/api/jimp/classes/jimp/#drawrect)\n- [drawEllipse](https://jimp-dev.github.io/jimp/api/jimp/classes/jimp/#drawellipse)\n- [drawPolygon](https://jimp-dev.github.io/jimp/api/jimp/classes/jimp/#drawpolygon)\n- [drawPath](https://jimp-dev.github.io/jimp/api/jimp/classes/jimp/#drawpath)\n- [floodFill](https://jimp-dev.github.io/jimp/api/jimp/classes/jimp/#floodfill)\n\n```ts\nimport { Jimp } from \"jimp\";\n\nconst image = new Jimp({ width: 300, height: 200, color: \"white\" });\n\nimage\n  .drawRect({ x: 20, y: 20, w: 120, h: 80, radius: 12, fill: \"#a8dadc\" })\n  .drawEllipse({\n    cx: 220,\n    cy: 60,\n    rx: 40,\n    ry: 40,\n    stroke: \"#1d3557\",\n    strokeWidth: 4,\n  })\n  .drawLine({\n    x1: 20,\n    y1: 150,\n    x2: 280,\n    y2: 180,\n    color: \"#e63946\",\n    width: 6,\n    cap: \"round\",\n  })\n  .drawPath({ path: \"M 150 190 Q 200 110 250 190 Z\", fill: \"gold\" });\n```\n\nSee [Getting Started](https://jimp-dev.github.io/jimp/guides/getting-started/) to read an image, change it and save the result with `write` or `getBuffer`.\n\n## How drawing works\n\n- Coordinates are in pixels from the top left, and can be fractions. Pixel (x, y) covers the square from (x, y) to (x + 1, y + 1).\n- Edges are antialiased by how much of each pixel the shape covers, so a rectangle on whole pixels has crisp edges.\n- Shapes are drawn over the image with source-over compositing, the same as `composite`: a color's alpha, and how much of a pixel is covered, set how much of the pixel below shows through.\n- Anything outside the image is clipped. Coordinates outside the image are fine and never throw.\n- Strokes are centered on the outline, like SVG and canvas. A 1 pixel line on whole pixel coordinates covers half of two rows, so it looks blurry: add 0.5 to the coordinates to cover one row.\n- Shapes with a `fill` and a `stroke` are filled first and stroked on top. With neither, they're filled black.\n- Numbers that aren't finite (`NaN`, `Infinity`) and invalid colors throw.\n\n## Colors and gradients\n\nAnywhere a color goes (`color`, `fill`, `stroke`) you can use:\n\n- a hex number, `0xRRGGBBAA`\n- a CSS color, like `\"red\"`, `\"#ff000080\"` or `\"rgba(255, 0, 0, 0.5)\"`. It's converted to the image's colour space, and an invalid one throws, e.g. `Invalid color \"notacolor\"`.\n- an object of pixel values from 0 to 255, `{ r, g, b, a }`. `a` defaults to 255.\n- a gradient. Its coordinates are in image pixels, like canvas, not relative to the shape.\n\n```ts\n// Along the line from (x1, y1) to (x2, y2)\nimage.drawRect({\n  x: 0,\n  y: 0,\n  w: 300,\n  h: 200,\n  fill: {\n    type: \"linear\",\n    x1: 0,\n    y1: 0,\n    x2: 0,\n    y2: 200,\n    stops: [\n      { offset: 0, color: \"#a8dadc\" },\n      { offset: 1, color: \"#f1faee\" },\n    ],\n  },\n});\n\n// From the center (cx, cy) out to radius r\nimage.drawEllipse({\n  cx: 150,\n  cy: 100,\n  rx: 50,\n  ry: 50,\n  fill: {\n    type: \"radial\",\n    cx: 150,\n    cy: 100,\n    r: 50,\n    stops: [\n      { offset: 0, color: \"#ffd166\" },\n      { offset: 1, color: \"rgba(255, 209, 102, 0)\" },\n    ],\n  },\n});\n```\n\nStop offsets go from 0 to 1, and before the first stop and after the last the gradient is that stop's color. Two stops at the same offset make a hard edge. Colors are blended with premultiplied alpha, like CSS, so fading to transparent doesn't go grey.\n\n## Shapes\n\n| Method        | Options                                                                                                                                                                       |\n| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `drawLine`    | `x1`, `y1`, `x2`, `y2`, `color`, `width` (default 1), `cap`                                                                                                                   |\n| `drawRect`    | `x`, `y`, `w`, `h`, `radius` (a number or `{ topLeft, topRight, bottomRight, bottomLeft }`), `strokeAlign` (`\"center\"`, `\"inside\"` like a CSS border, or `\"outside\"`), `join` |\n| `drawEllipse` | `cx`, `cy`, `rx`, `ry` (the same for a circle)                                                                                                                                |\n| `drawPolygon` | `points` (`[x, y]` pairs or `{ x, y }` objects), `closed` (default true), `cap`, `join`, `fillRule`                                                                           |\n| `drawPath`    | `path` (SVG path data or a list of commands), `cap`, `join`, `fillRule`                                                                                                       |\n\nAll but `drawLine` also take `fill`, `stroke` and `strokeWidth` (default 1). The stroke styles are the same as SVG's:\n\n- `cap`, for the ends of open lines: `\"butt\"` (default) stops at the end point, `\"round\"` adds a half circle and `\"square\"` adds half the width.\n- `join`, for corners: `\"miter\"` (default) is sharp, `\"round\"` is rounded and `\"bevel\"` is cut off. Miters longer than `miterLimit` (default 10) times the width are beveled.\n- `fillRule`, for shapes that overlap themselves: `\"nonzero\"` (default) fills everything inside any outline unless an inner outline goes the other way round, and `\"evenodd\"` makes every nested outline a hole.\n\n```ts\n// A five-pointed star. With \"evenodd\" its middle is empty.\nimage.drawPolygon({\n  points: [\n    [50, 5],\n    [79, 95],\n    [2, 40],\n    [98, 40],\n    [21, 95],\n  ],\n  fill: \"gold\",\n  stroke: \"black\",\n  strokeWidth: 2,\n  join: \"round\",\n});\n\n// A ring\nimage.drawPath({\n  path: \"M 10 50 A 40 40 0 1 0 90 50 A 40 40 0 1 0 10 50 Z M 30 50 A 20 20 0 1 0 70 50 A 20 20 0 1 0 30 50 Z\",\n  fill: \"#2a9d8f\",\n  fillRule: \"evenodd\",\n});\n```\n\n`drawPath` reads every SVG path command (`M L H V C S Q T A Z`, absolute and relative), or a list of commands like `{ type: \"M\", x, y }`, `{ type: \"L\", x, y }`, `{ type: \"Q\", x1, y1, x, y }`, `{ type: \"C\", x1, y1, x2, y2, x, y }` and `{ type: \"Z\" }`.\n\n## Flood fill\n\n`floodFill` fills the area around a point like a paint bucket: every pixel connected to it (up, down, left or right) whose color is within `tolerance` of its color.\n\n```ts\nimage.floodFill({ x: 10, y: 10, color: \"#ffcc00\", tolerance: 0.1 });\n```\n\n`tolerance` goes from 0 (only the exact color, the default) to 1 (everything). It's the biggest difference in any channel, as a fraction of 255, with alpha premultiplied, so every fully transparent pixel matches every other. The fill is drawn over the pixels, so a semi-transparent color blends with them, and it can be a gradient. A point outside the image fills nothing.\n\n## Drawing from other plugins\n\nThe rasterizer the methods use is exported, so other plugins can draw their own shapes, like the glyphs of a font:\n\n| Export            | What it does                                                                                                    |\n| ----------------- | --------------------------------------------------------------------------------------------------------------- |\n| `parseSvgPath`    | Parses SVG path data into absolute `M`, `L`, `Q`, `C` and `Z` commands                                          |\n| `flattenPath`     | Turns a path into polylines, with curves split into lines within `tolerance` pixels and an optional `transform` |\n| `strokePolylines` | Turns polylines into the outlines of strokes, with `width`, `cap`, `join` and `miterLimit`                      |\n| `rasterize`       | Works out each pixel's coverage of polylines, row by row, with a fill rule                                      |\n| `fillPolylines`   | Fills polylines on an image with a color or gradient                                                            |\n| `fillPath`        | Flattens and fills a path on an image                                                                           |\n| `strokePath`      | Flattens and strokes a path on an image                                                                         |\n| `drawShape`       | Fills and then strokes polylines, like the drawing methods, with `fill`, `stroke`, `strokeWidth` and `join`     |\n| `PaintSchema`     | The zod schema of a color or gradient, to validate options that take one                                        |\n\nPath commands use the same objects as opentype.js, so a glyph's `path.commands` can be drawn as they are. Transforms are `[a, b, c, d, e, f]` matrices, like CSS's `matrix()`.\n\n```ts\nimport { fillPath } from \"@jimp/plugin-draw\";\n\nconst glyph = font.charToGlyph(\"g\");\nconst scale = 48 / font.unitsPerEm;\n\n// Font units have y pointing up, so flip them\nfillPath(image, glyph.path.commands, \"black\", {\n  transform: [scale, 0, 0, -scale, x, baseline],\n});\n```\n\nTo fill many shapes as one, like the glyphs of a line of text, flatten them all and fill them in one call: where they overlap, their edges blend correctly.\n\n```ts\nimport { fillPolylines, flattenPath } from \"@jimp/plugin-draw\";\n\nfillPolylines(\n  image,\n  glyphs.flatMap((glyph) =>\n    flattenPath(glyph.commands, { transform: glyph.transform }),\n  ),\n  \"black\",\n);\n```\n\n`rasterize` gives coverage instead of drawing it, to draw somewhere else, like a mask:\n\n```ts\nimport { rasterize } from \"@jimp/plugin-draw\";\n\nconst mask = new Float32Array(width * height);\n\nrasterize(\n  polylines,\n  { width, height, fillRule: \"nonzero\" },\n  (y, x0, x1, coverage) => {\n    mask.set(coverage.subarray(x0, x1), y * width + x0);\n  },\n);\n```\n\nCoverage is exact: each pixel's is the area of it inside the shape, worked out from the edges crossing it (the same method as FreeType and font-rs), not sampled.","users":{}}