{"_id":"@gatsbyjs/potrace","_rev":"38-b28bc5f3ba10ae2162cb95db71885e7c","name":"@gatsbyjs/potrace","dist-tags":{"latest":"3.0.0"},"versions":{"2.2.0":{"name":"@gatsbyjs/potrace","version":"2.2.0","keywords":["potrace","trace","tracing","svg","bitmap","posterization"],"author":{"name":"mattmc"},"license":"GPL-3.0","_id":"@gatsbyjs/potrace@2.2.0","maintainers":[{"name":"j0sh77","email":"jcjohnson77@gmail.com"},{"name":"mcolelittle","email":"mcolelittle@gmail.com"},{"name":"tyhopp","email":"hopp.ty.c@gmail.com"},{"name":"kgarbaya","email":"kgarbaya@gmail.com"},{"name":"marvinjudehk","email":"marvinjudehk@gmail.com"},{"name":"pvorozhe","email":"vorozheykinap@gmail.com"},{"name":"pauliescanlon","email":"pauliescanlon@gmail.com"},{"name":"kylemathews","email":"mathews.kyle@gmail.com"},{"name":"leithonenglish","email":"leithonenglish@gmail.com"},{"name":"dschau","email":"dustinschau@gmail.com"},{"name":"pieh","email":"misiek.piechowiak@gmail.com"},{"name":"wardpeet","email":"ward@coding-tech.com"},{"name":"tylerbarnes","email":"tyler@known.design"},{"name":"fk","email":"sechskilo@gmail.com"},{"name":"smthomas","email":"shane@codekarate.com"},{"name":"lekoarts","email":"lekoarts@gmail.com"},{"name":"dmccraw","email":"dustinmccraw@yahoo.com"},{"name":"abhiaiyer","email":"abhiaiyer91+npm@gmail.com"},{"name":"julienp","email":"julien@caffeine.lu"},{"name":"rachelbahl","email":"rachel@gatsbyjs.com"},{"name":"daniellewgatsby","email":"daniel.lew@gatsbyjs.com"},{"name":"veryspry","email":"ehlinger.matt@gmail.com"},{"name":"mlgualtieri-gatsby","email":"mike.gualtieri@gatsbyjs.com"},{"name":"gatsby_integrations","email":"integrations-collab-squad@gatsbyjs.com"}],"homepage":"https://github.com/tooolbox/node-potrace#readme","bugs":{"url":"https://github.com/tooolbox/node-potrace/issues"},"dist":{"shasum":"56e88e420c65bb3065caa27772c6acd1c16c4ec4","tarball":"https://registry.npmjs.org/@gatsbyjs/potrace/-/potrace-2.2.0.tgz","fileCount":18,"integrity":"sha512-/RiLVFJA+CIYhceb6XL1kD1GZ5E2JBX38pld0fiGNiNwLl+Bb7TYZR72aQvcs3v+NOrSjbagUiCnIHYmEW4F7w==","signatures":[{"sig":"MEYCIQD4vpQ6QWuM28nzJYXv1ksKlTB97LjyVx5hW/Yz8E+UeQIhAK4kpbRNsohFIBEyrflZdEn9YNaoqbJi+C4SRdrDeBJt","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86915,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiQ3WZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqQ/g/+NdzpP2ibzgSVGOf1edzFNMgD1MhUnOQ3MBOztiH5eexzeesM\r\n094rrj42SPHXGH+JfKZUYCi8fbkvBzlrKiskkJumPMlLC53hCM/10ol29iY7\r\nMGDpJL5Ay6LzXNUjfwhFLL1wMZ1UV2KxxxpbWvsJGH2MZyJopgAaW+vpis4l\r\nuqORfNirjmkhDSPz1XD9yUh7mxy7zZonpAWlvsaVA0jvxBuMqIUHEnSZrSNm\r\n4iaDaz4R6HgGKW5F+BLvCad3e5WJsUZMsfyoMyWmyQGeMpEVUA4cAL84AHXL\r\nOhwcsd4HuP7j5mlLAbTocBIA0R5P/3aQxIhSv4QaVTYyEOzeyr5rX+uuJCFd\r\nw6gj2bKr2BlXPwma8LVgVQm0tDOSCQGbHCE8NR85AqpOxFH7lfwHxHB1vD3A\r\nJZYGhfSKrctZrl7DdPkrcm9Fw7/DUITVyi6QOA0jXnBmYznRz+KAx+Yvubld\r\njHfgKzvCZPCgvSVr6n5jC27KizgcTSGJZZH6AG7iZxkCaANflhowNKJHglO4\r\nJvSawqo3vWhrZo8BF8hTpHAYtOU1ywQ6wVHv/WreORYLm7ou3STXJoByyHcL\r\nBVbQDRCa4ucbL68v+2lr93NVYC8UdeyW+fO9gKZRycqgwljbgnLvbn3CJI34\r\naHGdHmDO10awjVL676gAqRG62D9v7OjZlFE=\r\n=FRKo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"d0d3bf40757998187f9adfd90fdda4002032b95a","scripts":{"test":"cd test && mocha test.js --reporter spec"},"_npmUser":{"name":"wardpeet","email":"ward@coding-tech.com"},"repository":{"url":"git+https://github.com/tooolbox/node-potrace.git","type":"git"},"_npmVersion":"6.14.14","description":"Potrace in Javascript, for NodeJS","directories":{},"_nodeVersion":"14.17.5","dependencies":{"jimp":"^0.16.1"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^6.1.4","sinon":"^7.3.2","lodash":"^4.17.21","should":"^13.2.3","should-sinon":"0.0.6"},"_npmOperationalInternal":{"tmp":"tmp/potrace_2.2.0_1648588184288_0.5637557870309498","host":"s3://npm-registry-packages"}},"2.3.0":{"name":"@gatsbyjs/potrace","version":"2.3.0","keywords":["potrace","trace","tracing","svg","bitmap","posterization"],"author":{"name":"mattmc"},"license":"GPL-3.0","_id":"@gatsbyjs/potrace@2.3.0","maintainers":[{"name":"nodebotanist","email":"the@nodebotani.st"},{"name":"j0sh77","email":"jcjohnson77@gmail.com"},{"name":"mcolelittle","email":"mcolelittle@gmail.com"},{"name":"tyhopp","email":"hopp.ty.c@gmail.com"},{"name":"kgarbaya","email":"kgarbaya@gmail.com"},{"name":"marvinjudehk","email":"marvinjudehk@gmail.com"},{"name":"kylemathews","email":"mathews.kyle@gmail.com"},{"name":"dschau","email":"dustinschau@gmail.com"},{"name":"pieh","email":"misiek.piechowiak@gmail.com"},{"name":"wardpeet","email":"ward@coding-tech.com"},{"name":"tylerbarnes","email":"tyler@known.design"},{"name":"fk","email":"sechskilo@gmail.com"},{"name":"smthomas","email":"shane@codekarate.com"},{"name":"lekoarts","email":"lekoarts@gmail.com"},{"name":"dmccraw","email":"dustinmccraw@yahoo.com"},{"name":"abhiaiyer","email":"abhiaiyer91+npm@gmail.com"},{"name":"julienp","email":"julien@caffeine.lu"},{"name":"rachelbahl","email":"rachel@gatsbyjs.com"},{"name":"daniellewgatsby","email":"daniel.lew@gatsbyjs.com"},{"name":"mlgualtieri-gatsby","email":"mike.gualtieri@gatsbyjs.com"},{"name":"gatsby_integrations","email":"integrations-collab-squad@gatsbyjs.com"}],"homepage":"https://github.com/tooolbox/node-potrace#readme","bugs":{"url":"https://github.com/tooolbox/node-potrace/issues"},"dist":{"shasum":"0ac22fb56a02ebc64ce55e4666c4b741cbf27377","tarball":"https://registry.npmjs.org/@gatsbyjs/potrace/-/potrace-2.3.0.tgz","fileCount":18,"integrity":"sha512-72szhSY/4tPiPPOzq15CG6LW0s9FuWQ86gkLSUvBNoF0s+jsEdRaZmATYNjiY2Skg//EuyPLEqUQnXKXME0szg==","signatures":[{"sig":"MEYCIQCAV9NV5Cgi227i+G9jVcDye8AWGpMmz/Pn/hw9LBoQjAIhANjkTrA6KPycXFAm6D1UMOERqx4kV8Sgu8T86E0HnBr/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86941,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/4JhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrZcg//cHxUtkzBnOo10fYDMRrIiZxKVg9PztD2WJvLO0osNGETgWgZ\r\nfZSbzmnjTHtRfwS924gqkPNysvT1QhK19sZRWxv3nA1/Ja6qGPK7/1It7bbM\r\niAvEcCYfGORJIdnO4+WPztrkQsQUmudd77Ng2D3iCkgMC2dAXbJYJJpyTIHv\r\nROYWm6JW9nn+puVstksAxXLFz2QNjStmvxzGkOXDwRUu8GLrkZGH6Slrlrwq\r\n/wyXpgl/ekMwh2YrRnU2lUElVzuoKRpVzIzh7mxFCqhYQxwVHcZnHx3WmSDq\r\n5W0/AQARvlP5arFmdaGbsLBhTWF68paHpNA5jHw7ElDKsA3a8ZHFpZFyYmZD\r\n9d1AuZ+7itjo9D2RxgF1Wgohc5bK+TTIWkthNEPz7JdGkd/vKKVZsfSWPaaK\r\ne1pQWNe/Hffn3raUd0LmU7bCF8eHudcZ4vinqjm+z0DOg3pNPfKrHgk0P/IZ\r\nv8SUd5jQw9w9Yv/UFGpTam/6DT1TCohVjnaKwB6neYYrKB/TU9RAe1fd7v6e\r\n9SbxRR8fiFTHAF1KuMSAQA0o8i/TvmFMrGw24XAXwhgt9XoBXx8BfneQ/BNG\r\nyZBc/dTqEbC+C9PxiByKVzhqbgd9kGiWKL+mnjT2LybZMOLrFTylV6JZAR9k\r\nP4UeXEqUCLSIGbQbkVzkKTlQ71Iqq6aHRQk=\r\n=dMOm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"34a92f8d3fadd8f14df030b1c4085830e932ecdf","scripts":{"test":"cd test && mocha test.js --reporter spec"},"_npmUser":{"name":"pieh","email":"misiek.piechowiak@gmail.com"},"repository":{"url":"git+https://github.com/tooolbox/node-potrace.git","type":"git"},"_npmVersion":"8.13.2","description":"Potrace in Javascript, for NodeJS","directories":{},"_nodeVersion":"16.15.1","dependencies":{"jimp-compact":"^0.16.1-2"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^6.1.4","sinon":"^7.3.2","lodash":"^4.17.21","should":"^13.2.3","should-sinon":"0.0.6"},"_npmOperationalInternal":{"tmp":"tmp/potrace_2.3.0_1660912224821_0.7182703791613871","host":"s3://npm-registry-packages"}},"3.0.0":{"name":"@gatsbyjs/potrace","version":"3.0.0","keywords":["potrace","trace","tracing","svg","bitmap","posterization"],"author":{"name":"mattmc"},"license":"GPL-2.0","_id":"@gatsbyjs/potrace@3.0.0","maintainers":[{"name":"smcgarity","email":"sophiemcgarity7@gmail.com"},{"name":"kathmbeck","email":"katherine.beck@gatsbyjs.com"},{"name":"nodebotanist","email":"the@nodebotani.st"},{"name":"j0sh77","email":"jcjohnson77@gmail.com"},{"name":"mcolelittle","email":"mcolelittle@gmail.com"},{"name":"tyhopp","email":"hopp.ty.c@gmail.com"},{"name":"kgarbaya","email":"kgarbaya@gmail.com"},{"name":"marvinjudehk","email":"marvinjudehk@gmail.com"},{"name":"kylemathews","email":"mathews.kyle@gmail.com"},{"name":"dschau","email":"dustinschau@gmail.com"},{"name":"pieh","email":"misiek.piechowiak@gmail.com"},{"name":"wardpeet","email":"ward@coding-tech.com"},{"name":"tylerbarnes","email":"tyler@known.design"},{"name":"fk","email":"sechskilo@gmail.com"},{"name":"smthomas","email":"shane@codekarate.com"},{"name":"lekoarts","email":"lekoarts@gmail.com"},{"name":"dmccraw","email":"dustinmccraw@yahoo.com"},{"name":"abhiaiyer","email":"abhiaiyer91+npm@gmail.com"},{"name":"julienp","email":"julien@caffeine.lu"},{"name":"rachelbahl","email":"rachel@gatsbyjs.com"},{"name":"daniellewgatsby","email":"daniel.lew@gatsbyjs.com"},{"name":"mlgualtieri-gatsby","email":"mike.gualtieri@gatsbyjs.com"},{"name":"gatsby_integrations","email":"integrations-collab-squad@gatsbyjs.com"}],"homepage":"https://github.com/tooolbox/node-potrace#readme","bugs":{"url":"https://github.com/tooolbox/node-potrace/issues"},"dist":{"shasum":"38e25c90bfc21f770c081b57b50e37d028346362","tarball":"https://registry.npmjs.org/@gatsbyjs/potrace/-/potrace-3.0.0.tgz","fileCount":18,"integrity":"sha512-I9iEwLqbgB7tDYy8HrbJd3okhlesMZq+3CqUSko6QN+HpH7nzO2Il8RsN0Z/AAhpePcJIzvsELe6HsIyB/23TA==","signatures":[{"sig":"MEUCIQDOtL8QWqLKA2H9xM0KRXIX194tj34akZ6GV0NZWF4yQwIgEFOaaXSUcZ82Pt3yuKbXeqtTInp+TaXhhAMFDw9CCOI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":97337,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjgJ6OACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqg7Q/7B30McOzHKAKtMZLJo5MU8kP6Dza0dmkAA94DjNRIpe/YZb0c\r\nS8p5AZPchJZV5cVfD2NDaEJJ8pWoV3kU2M9zyyutdp09MwINlJbJEYNAxJ51\r\n7YDs12NWTUg6LMWSyTZd9dt0Pug0D/y5MDHZ9iM5YgkJBlBioShCfB1Wa///\r\nnipEkrSoaq9abT7wVvvdvrI24wTf5fTzOzEdJ9vU1Otx/RplSwkbHtpuc36M\r\nTB6YfCLP3Lt25inls0w05C7EnKpoI/399lKiBOGSvoxT69KnsyBDFJ7KeBWS\r\n9MHUNl5li2r+Gnr2HzqeMeycAvEWf6AQy+zwpOZDD7x4oNWEdJjHmqIk5pUh\r\nKeYQf9ctAftnv6qDIZaJggBc20pkLYIvTOE1vvHzm3D+c5NavX94j/Eu4ksu\r\nQf6weJ6ObWa1R+1IQqJn8FerYlZgPO30ffv0mcO/J/G6hLRDzWJcLxivgsuJ\r\nCfDKjYfdFPChQa6F8GErBk+elpUBCWh4Mw89VDoMeQCgln4wyvYJhLNvyuMg\r\ngR02QfXabYtzjIEsQ+HMkFXDx7PlRXNk/kFGcJcu4xE6kdn8Q0v1a6TFgEb8\r\nCqKBWte+p41ci/NbnNCLmPjFbWoFr28Ikj872rRYxm3GS9o2iF061OV42POK\r\nyZDkgZU5XE17Ka8dR0Q+/qCSjgNZO+9ML+A=\r\n=OXQV\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","gitHead":"eba20c856be007a229689a22c004169fa697577d","scripts":{"test":"cd test && mocha test.js --reporter spec"},"_npmUser":{"name":"pieh","email":"misiek.piechowiak@gmail.com"},"repository":{"url":"git+https://github.com/tooolbox/node-potrace.git","type":"git"},"_npmVersion":"8.19.1","description":"Potrace in Javascript, for NodeJS","directories":{},"_nodeVersion":"18.9.0","dependencies":{"jimp-compact":"^0.16.1-2"},"_hasShrinkwrap":false,"devDependencies":{"mocha":"^6.1.4","sinon":"^7.3.2","lodash":"^4.17.21","should":"^13.2.3","should-sinon":"0.0.6"},"_npmOperationalInternal":{"tmp":"tmp/potrace_3.0.0_1669373582496_0.416951539669713","host":"s3://npm-registry-packages"}}},"time":{"created":"2022-03-29T21:09:44.231Z","modified":"2026-06-30T21:59:41.901Z","2.2.0":"2022-03-29T21:09:45.037Z","2.3.0":"2022-08-19T12:30:24.999Z","3.0.0":"2022-11-25T10:53:02.707Z"},"bugs":{"url":"https://github.com/tooolbox/node-potrace/issues"},"author":{"name":"mattmc"},"license":"GPL-2.0","homepage":"https://github.com/tooolbox/node-potrace#readme","keywords":["potrace","trace","tracing","svg","bitmap","posterization"],"repository":{"url":"git+https://github.com/tooolbox/node-potrace.git","type":"git"},"description":"Potrace in Javascript, for NodeJS","maintainers":[{"email":"misiek.piechowiak@gmail.com","name":"pieh"},{"email":"mike.gualtieri@netlify.com","name":"mlgualtieri-gatsby"},{"email":"philippe.serhal@netlify.com","name":"serhalp-netlify"}],"readme":"\n\n# node-potrace\nA NodeJS-compatible fork of [Potrace in JavaScript][potrace-by-kilobtye] with some additions, which is in turn a port of [the original Potrace][potrace] — a tool for tracing bitmaps.\n\n![Node.js CI](https://github.com/tooolbox/node-potrace/workflows/Node.js%20CI/badge.svg)\n\n## Example and demo\n\n| **Original image**        | **Potrace output**           | **Posterized output**                   |\n|---------------------------|------------------------------|-----------------------------------------|\n| ![](test/sources/yao.jpg) | ![](https://cdn.rawgit.com/tooolbox/node-potrace/9ee822d/test/example-output.svg) | ![](https://cdn.rawgit.com/tooolbox/node-potrace/9ee822d/test/example-output-posterized.svg) |\n\n(Example image inherited from [online demo of the browser version][potrace-js-demo])\n\n## Usage\n\nInstall\n\n```sh\nnpm install potrace\n```\n\nBasic usage\n\n```js\nvar potrace = require('potrace'),\n    fs = require('fs');\n\npotrace.trace('./path/to/image.png', function(err, svg) {\n  if (err) throw err;\n  fs.writeFileSync('./output.svg', svg);\n});\n```\n\nYou can also provide a configuration object as a second argument.\n\n```js\nvar params = {\n  background: '#49ffd2',\n  color: 'blue',\n  threshold: 120\n};\n\npotrace.trace('./path/to/image.png', params, function(err, svg) {\n  /*...*/\n});\n```\n\nIf you want to run Potrace algorithm multiple times on the same image with different threshold setting and merge results together in a single file - `posterize` method does exactly that.\n\n```js\npotrace.posterize('./path/to/image.png', { threshold: 180, steps: 4 }, function(err, svg) {\n  /*...*/\n});\n\n// or if you know exactly where you want to break it on different levels\n\npotrace.posterize('./path/to/image.png', { steps: [40, 85, 135, 180] }, function(err, svg) {\n  /*...*/\n});\n```\n\n### Advanced usage and configuration\n\nBoth `trace` and `posterize` methods return instances of `Potrace` and `Posterizer` classes respectively to a callback function as third argument. \n\nYou can also instantiate these classes directly:\n\n```js\nvar potrace = require('potrace');\n\n// Tracing\n\nvar trace = new potrace.Potrace();\n\n// You can also pass configuration object to the constructor\ntrace.setParameters({\n  threshold: 128,\n  color: '#880000'\n});\n\ntrace.loadImage('path/to/image.png', function(err) {\n  if (err) throw err;\n\n  trace.getSVG(); // returns SVG document contents\n  trace.getPathTag(); // will return just <path> tag\n  trace.getSymbol('traced-image'); // will return <symbol> tag with given ID\n});\n\n// Posterization\n\nvar posterizer = new potrace.Posterize();\n\nposterizer.loadImage('path/to/image.png', function(err) {\n  if (err) throw err;\n  \n  posterizer.setParameter({\n    color: '#ccc',\n    background: '#222',\n    steps: 3,\n    threshold: 200,\n    fillStrategy: potrace.Posterize.FILL_MEAN\n  });\n  \n  posterizer.getSVG();\n  // or\n  posterizer.getSymbol('posterized-image');\n});\n```\n\nCallback function provided to `loadImage` methods will be executed in context of the `Potrace`/`Posterizer` instance, so if it doesn't go against your code style - you can just do\n\n```js\nnew potrace.Potrace()\n  .loadImage('path/to/image.bmp', function() {\n    if (err) throw err;\n    this.getSymbol('foo');\n  });\n```\n\n[Jimp module][jimp] is used on the back end, so first argument accepted by `loadImage` method could be anything Jimp can read: a `Buffer`, local path or a url string. Supported formats are: PNG, JPEG or BMP. It also could be a Jimp instance (provided bitmap is not modified)\n\n### Parameters\n\n`Potrace` class expects following parameters:\n\n- **turnPolicy** - how to resolve ambiguities in path decomposition. Possible values are exported as constants: `TURNPOLICY_BLACK`, `TURNPOLICY_WHITE`, `TURNPOLICY_LEFT`, `TURNPOLICY_RIGHT`, `TURNPOLICY_MINORITY`, `TURNPOLICY_MAJORITY`. Refer to [this document][potrace-algorithm] for more information (page 4)  \n  (default: `TURNPOLICY_MINORITY`)\n- **turdSize** - suppress speckles of up to this size   \n  (default: 2)\n- **alphaMax** - corner threshold parameter   \n  (default: 1)\n- **optCurve** - curve optimization   \n  (default: true)\n- **optTolerance** - curve optimization tolerance   \n  (default: 0.2)\n- **threshold** - threshold below which color is considered black.\n  Should be a number in range 0..255 or `THRESHOLD_AUTO` in which case threshold will be selected automatically using [Algorithm For Multilevel Thresholding][multilevel-thresholding]  \n  (default: `THRESHOLD_AUTO`)  \n- **blackOnWhite** - specifies colors by which side from threshold should be turned into vector shape  \n  (default: `true`)  \n- **color** - Fill color. Will be ignored when exporting as \\<symbol\\>. (default: `COLOR_AUTO`, which means black or white, depending on `blackOnWhite` property)\n- **background** - Background color. Will be ignored when exporting as \\<symbol\\>. By default is not present (`COLOR_TRANSPARENT`)\n\n---------------\n\n`Posterizer` class has same methods as `Potrace`, in exception of `.getPathTag()`. \nConfiguration object is extended with following properties:\n\n- **fillStrategy** - determines how fill color for each layer should be selected. Possible values are exported as constants:  \n    - `FILL_DOMINANT` - most frequent color in range (used by default), \n    - `FILL_MEAN` - arithmetic mean (average), \n    - `FILL_MEDIAN` - median color, \n    - `FILL_SPREAD` - ignores color information of the image and just spreads colors equally in range 0..\\<threshold\\> (or \\<threshold\\>..255 if `blackOnWhite` is set to `false`),\n- **rangeDistribution** - how color stops for each layer should be selected. Ignored if `steps` is an array. Possible values are:\n    - `RANGES_AUTO` - Performs automatic thresholding (using [Algorithm For Multilevel Thresholding][multilevel-thresholding]). Preferable method for already posterized sources, but takes long time to calculate 5 or more thresholds (exponential time complexity)  \n      *(used by default)*\n    - `RANGES_EQUAL` - Ignores color information of the image and breaks available color space into equal chunks\n- **steps** - Specifies desired number of layers in resulting image. If a number provided - thresholds for each layer will be automatically calculated according to `rangeDistribution` parameter. If an array provided it expected to be an array with precomputed thresholds for each layer (in range 0..255)  \n  (default: `STEPS_AUTO` which will result in `3` or `4`, depending on `threshold` value)\n- **threshold** - Breaks image into foreground and background (and only foreground being broken into desired number of layers). Basically when provided it becomes a threshold for last (least opaque) layer and then `steps - 1` intermediate thresholds calculated. If **steps** is an array of thresholds and every value from the array is lower (or larger if **blackOnWhite** parameter set to `false`) than threshold - threshold will be added to the array, otherwise just ignored.  \n  (default: `Potrace.THRESHOLD_AUTO`)\n- *all other parameters that Potrace class accepts*\n\n**Notes:**\n\n- When number of `steps` is greater than 10 - an extra layer could be added to ensure presence of darkest/brightest colors if needed to ensure presence of probably-important-at-this-point details like shadows or line art.\n- With big number of layers produced image will be looking brighter overall than original due to math error at the rendering phase because of how layers are composited.\n- With default configuration `steps`, `threshold` and `rangeDistribution` settings all set to auto, resulting in a 4 thresholds/color stops being calculated with Multilevel Thresholding algorithm mentioned above. Calculation of 4 thresholds takes 3-5 seconds on average laptop. You may want to explicitly limit number of `steps` to 3 to moderately improve processing speed.  \n\n## Thanks to\n\n- Peter Selinger for [original Potrace tool and algorithm][potrace]\n- @kilobtye for original [javascript port][potrace-by-kilobtye]\n\n## License\n\nThe GNU General Public License version 2 (GPLv2). Please see [License File](LICENSE) for more information.\n\n[potrace]: http://potrace.sourceforge.net/\n[potrace-algorithm]: http://potrace.sourceforge.net/potrace.pdf\n[multilevel-thresholding]: http://www.iis.sinica.edu.tw/page/jise/2001/200109_01.pdf\n[potrace-by-kilobtye]: https://github.com/kilobtye/potrace\n[potrace-js-demo]: http://kilobtye.github.io/potrace/\n[jimp]: https://github.com/oliver-moran/jimp\n","readmeFilename":"README.md"}