{"_id":"@renoun/screenshot","_rev":"7-a7072ab0bb09586877f2a64ae07ccf33","name":"@renoun/screenshot","dist-tags":{"latest":"0.3.3"},"versions":{"0.1.0":{"name":"@renoun/screenshot","version":"0.1.0","keywords":["screenshot","image","capture","canvas","html"],"author":{"name":"souporserious"},"license":"MIT","_id":"@renoun/screenshot@0.1.0","maintainers":[{"name":"souporserious","email":"ftntravis@gmail.com"}],"homepage":"https://renoun.dev","bugs":{"url":"https://github.com/souporserious/renoun/issues"},"dist":{"shasum":"b6e576922d1d4666ee861aab2fceebc4b39926a2","tarball":"https://registry.npmjs.org/@renoun/screenshot/-/screenshot-0.1.0.tgz","fileCount":5,"integrity":"sha512-uqDIMx2xmkb07QB9HsW8Xr7GqVoEFjrB+u8DMb8apPihhUUxiNVfehYNYIbKYvJO1H06pFoOl5TGvXTjDKdcTw==","signatures":[{"sig":"MEYCIQC09lX2W309pTU4A+a2BYfeLJ+y0xuqEgdG2qybCzmG8AIhALoGRBlDp3gZtHek1IlY3vFZ+Hf7NBuBh/dFD3qan3E4","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@renoun%2fscreenshot@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":375469},"main":"dist/index.js","type":"module","_from":"file:renoun-screenshot-0.1.0.tgz","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"dev":"tsc -w","test":"vitest","build":"tsc"},"_npmUser":{"name":"souporserious","email":"ftntravis@gmail.com"},"_resolved":"/tmp/534b62e8b01b5975f18e20a8b1f6fe9e/renoun-screenshot-0.1.0.tgz","_integrity":"sha512-uqDIMx2xmkb07QB9HsW8Xr7GqVoEFjrB+u8DMb8apPihhUUxiNVfehYNYIbKYvJO1H06pFoOl5TGvXTjDKdcTw==","repository":{"url":"git+https://github.com/souporserious/renoun.git","type":"git","directory":"packages/screenshot"},"_npmVersion":"10.9.4","description":"Screenshot DOM elements as a canvas, blob, or URL.","directories":{},"sideEffects":false,"_nodeVersion":"22.21.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/screenshot_0.1.0_1766176159054_0.42652319167782826","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@renoun/screenshot","version":"0.1.1","keywords":["screenshot","image","capture","canvas","html"],"author":{"name":"souporserious"},"license":"MIT","_id":"@renoun/screenshot@0.1.1","maintainers":[{"name":"souporserious","email":"ftntravis@gmail.com"}],"homepage":"https://renoun.dev","bugs":{"url":"https://github.com/souporserious/renoun/issues"},"dist":{"shasum":"29c6b0c2f449c6bd54b51d005de7d33dbea81323","tarball":"https://registry.npmjs.org/@renoun/screenshot/-/screenshot-0.1.1.tgz","fileCount":5,"integrity":"sha512-a8zsHhzabz3L4xsuBmCHlU9ggDCd+0pIehERYtAxg2yddySCGcVrCRuiqGCj1FEAr++tIIDzxKkXyqb7jjoNWg==","signatures":[{"sig":"MEUCIQCR0REgwfpx6MZokXC+TeW/7OfZqUvAGo4mbGoGlC0HwQIgDbclbeud5C6S+TpWXWjWF2pGlT0UEj6mn9u2nEFiCAg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@renoun%2fscreenshot@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":418330},"main":"dist/index.js","type":"module","_from":"file:renoun-screenshot-0.1.1.tgz","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"dev":"tsc -w","test":"vitest","build":"tsc"},"_npmUser":{"name":"souporserious","email":"ftntravis@gmail.com"},"_resolved":"/tmp/35ad5d916bd5011401c0c3ca0255ae8a/renoun-screenshot-0.1.1.tgz","_integrity":"sha512-a8zsHhzabz3L4xsuBmCHlU9ggDCd+0pIehERYtAxg2yddySCGcVrCRuiqGCj1FEAr++tIIDzxKkXyqb7jjoNWg==","repository":{"url":"git+https://github.com/souporserious/renoun.git","type":"git","directory":"packages/screenshot"},"_npmVersion":"10.9.4","description":"Screenshot DOM elements as a canvas, blob, or URL.","directories":{},"sideEffects":false,"_nodeVersion":"22.21.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/screenshot_0.1.1_1767692677289_0.4234763182032941","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@renoun/screenshot","version":"0.2.0","keywords":["screenshot","image","capture","canvas","html"],"author":{"name":"souporserious"},"license":"MIT","_id":"@renoun/screenshot@0.2.0","maintainers":[{"name":"souporserious","email":"ftntravis@gmail.com"}],"homepage":"https://renoun.dev","bugs":{"url":"https://github.com/souporserious/renoun/issues"},"dist":{"shasum":"0bb852bd38b1176e556ee5b4239c91585cde42c4","tarball":"https://registry.npmjs.org/@renoun/screenshot/-/screenshot-0.2.0.tgz","fileCount":5,"integrity":"sha512-GJdytAi+nLCtyB5FrwYovcLUc27AzLP82j/p2NraTMe1SpbsUgvOBsSoX1rxAUOtJ41DoKHmPWxoZrhUsz9iBA==","signatures":[{"sig":"MEQCIF2e9twap/IgwBNpKtUVU/hKqzMUVME0i24FBP+zDbUAAiB7qgzgFygDAvcr7N4naKgIbzKIq36OKhqhk4aiq9g0GA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@renoun%2fscreenshot@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":426862},"main":"dist/index.js","type":"module","_from":"file:renoun-screenshot-0.2.0.tgz","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"dev":"tsc -w","test":"vitest","build":"tsc"},"_npmUser":{"name":"souporserious","email":"ftntravis@gmail.com"},"_resolved":"/tmp/270deb1065585f3bc954f2194a4cac2a/renoun-screenshot-0.2.0.tgz","_integrity":"sha512-GJdytAi+nLCtyB5FrwYovcLUc27AzLP82j/p2NraTMe1SpbsUgvOBsSoX1rxAUOtJ41DoKHmPWxoZrhUsz9iBA==","repository":{"url":"git+https://github.com/souporserious/renoun.git","type":"git","directory":"packages/screenshot"},"_npmVersion":"10.9.4","description":"Screenshot DOM elements as a canvas, blob, or URL.","directories":{},"sideEffects":false,"_nodeVersion":"22.21.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/screenshot_0.2.0_1767914348813_0.6853632126306985","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@renoun/screenshot","version":"0.3.0","keywords":["screenshot","image","capture","canvas","html"],"author":{"name":"souporserious"},"license":"MIT","_id":"@renoun/screenshot@0.3.0","maintainers":[{"name":"souporserious","email":"ftntravis@gmail.com"}],"homepage":"https://renoun.dev","bugs":{"url":"https://github.com/souporserious/renoun/issues"},"dist":{"shasum":"5b4df9dac157303fdae74fe09f806b8ea5e714df","tarball":"https://registry.npmjs.org/@renoun/screenshot/-/screenshot-0.3.0.tgz","fileCount":7,"integrity":"sha512-5tVfeNGvNTL1s52duYLOVLM6tx6yyK1YhiHGE89xDsSfkgqP5dRBjQt/vpD6BuMv1P0mtN8bTHRzwIWBGGfaIA==","signatures":[{"sig":"MEUCIQCxp/+9Zj1WUlNlV0JPEVORidmpEA6wgfen2XllX+NEuwIgDg7rz/aRCoYI5SiOVlYuaWZ5R4vZbsAtQeRNj34szrM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@renoun%2fscreenshot@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":453786},"main":"dist/index.js","type":"module","_from":"file:renoun-screenshot-0.3.0.tgz","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"dev":"tsc -w","test":"vitest","build":"tsc"},"_npmUser":{"name":"souporserious","email":"ftntravis@gmail.com"},"_resolved":"/tmp/47309e0d4e6568eba8c11c25e9507904/renoun-screenshot-0.3.0.tgz","_integrity":"sha512-5tVfeNGvNTL1s52duYLOVLM6tx6yyK1YhiHGE89xDsSfkgqP5dRBjQt/vpD6BuMv1P0mtN8bTHRzwIWBGGfaIA==","repository":{"url":"git+https://github.com/souporserious/renoun.git","type":"git","directory":"packages/screenshot"},"_npmVersion":"10.9.4","description":"Screenshot DOM elements as a canvas, blob, or URL.","directories":{},"sideEffects":false,"_nodeVersion":"22.21.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/screenshot_0.3.0_1768036601552_0.9633719097136246","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@renoun/screenshot","version":"0.3.1","keywords":["screenshot","image","capture","canvas","html"],"author":{"name":"souporserious"},"license":"MIT","_id":"@renoun/screenshot@0.3.1","maintainers":[{"name":"souporserious","email":"ftntravis@gmail.com"}],"homepage":"https://renoun.dev","bugs":{"url":"https://github.com/souporserious/renoun/issues"},"dist":{"shasum":"bf996eeea42270985e0a957faa5d3fad95f2202d","tarball":"https://registry.npmjs.org/@renoun/screenshot/-/screenshot-0.3.1.tgz","fileCount":5,"integrity":"sha512-l6qX/9suokpDGmUVWqeVhaPstSqQLEblJuL7jqnKagSvyE2HpVk7OizzhQuMKwoEV/PvWT1wXKSremgBVFsPrw==","signatures":[{"sig":"MEYCIQC5BpBu4ARzcy1jjd4kexCBZPABMa+TSdlk9vneKOW8NgIhANrNAshz5V3LAhXH/wAVZ5gPHB8BpB5z+U8MSdK7GeGp","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@renoun%2fscreenshot@0.3.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":435952},"main":"dist/index.js","type":"module","_from":"file:renoun-screenshot-0.3.1.tgz","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"dev":"tsc -w","test":"vitest","build":"tsc"},"_npmUser":{"name":"souporserious","email":"ftntravis@gmail.com"},"_resolved":"/tmp/29edc8039b79000f26bea76539e263db/renoun-screenshot-0.3.1.tgz","_integrity":"sha512-l6qX/9suokpDGmUVWqeVhaPstSqQLEblJuL7jqnKagSvyE2HpVk7OizzhQuMKwoEV/PvWT1wXKSremgBVFsPrw==","repository":{"url":"git+https://github.com/souporserious/renoun.git","type":"git","directory":"packages/screenshot"},"_npmVersion":"10.9.4","description":"Screenshot DOM elements as a canvas, blob, or URL.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/screenshot_0.3.1_1770423006285_0.6091014078987074","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"name":"@renoun/screenshot","version":"0.3.2","keywords":["screenshot","image","capture","canvas","html"],"author":{"name":"souporserious"},"license":"MIT","_id":"@renoun/screenshot@0.3.2","maintainers":[{"name":"souporserious","email":"ftntravis@gmail.com"}],"homepage":"https://renoun.dev","bugs":{"url":"https://github.com/souporserious/renoun/issues"},"dist":{"shasum":"954186d9a44fe85306631195de2699e5a79766de","tarball":"https://registry.npmjs.org/@renoun/screenshot/-/screenshot-0.3.2.tgz","fileCount":5,"integrity":"sha512-4c6qnYiOFd+MpFd4PSL7SnZeKOGpm2k9e69iWA+nzUQ4FGALEYsWrTSxAw+egI6WJ4LqLJAfTYIJkXPbyXn+qA==","signatures":[{"sig":"MEQCIDxCDZTODci2wvzuC9gX7TCjVcV8S9+25YbHSj2+iIK3AiBCXe6Jyac9yiujaMnvjXhK2SPsqElYHHVcwkWcgdThEg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@renoun%2fscreenshot@0.3.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":436083},"main":"dist/index.js","type":"module","_from":"file:renoun-screenshot-0.3.2.tgz","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"dev":"tsc -w","test":"vitest","build":"tsc"},"_npmUser":{"name":"souporserious","email":"ftntravis@gmail.com"},"_resolved":"/tmp/93c442d278083b07c2d7b9891f407723/renoun-screenshot-0.3.2.tgz","_integrity":"sha512-4c6qnYiOFd+MpFd4PSL7SnZeKOGpm2k9e69iWA+nzUQ4FGALEYsWrTSxAw+egI6WJ4LqLJAfTYIJkXPbyXn+qA==","repository":{"url":"git+https://github.com/souporserious/renoun.git","type":"git","directory":"packages/screenshot"},"_npmVersion":"10.9.4","description":"Screenshot DOM elements as a canvas, blob, or URL.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/screenshot_0.3.2_1770879102142_0.9135278470968629","host":"s3://npm-registry-packages-npm-production"}},"0.3.3":{"name":"@renoun/screenshot","version":"0.3.3","description":"Screenshot DOM elements as a canvas, blob, or URL.","author":{"name":"souporserious"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/souporserious/renoun.git","directory":"packages/screenshot"},"bugs":{"url":"https://github.com/souporserious/renoun/issues"},"homepage":"https://renoun.dev","keywords":["screenshot","image","capture","canvas","html"],"type":"module","main":"dist/index.js","types":"dist/index.d.ts","sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"build":"tsc","dev":"tsc -w","test":"vitest --run"},"_id":"@renoun/screenshot@0.3.3","_integrity":"sha512-aJuC1nUYksWSdmrnsjQsSlXuVhk57iIjELA3siap+9vNtg9wtExmIzMnZk+5/xI2ika8yR4CsQHS7toSBwW4fw==","_resolved":"/tmp/37d437cafe2baa744919fb02358b98b0/renoun-screenshot-0.3.3.tgz","_from":"file:renoun-screenshot-0.3.3.tgz","_nodeVersion":"22.22.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-aJuC1nUYksWSdmrnsjQsSlXuVhk57iIjELA3siap+9vNtg9wtExmIzMnZk+5/xI2ika8yR4CsQHS7toSBwW4fw==","shasum":"e237a17610b155aa0dc9e96b3ea21dcd85da2996","tarball":"https://registry.npmjs.org/@renoun/screenshot/-/screenshot-0.3.3.tgz","fileCount":5,"unpackedSize":442003,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@renoun%2fscreenshot@0.3.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCH5iCOyKhuF5VQQBCl4nPuLmydFcKdC2qBMU2AiYdO2wIhAPdEnx/DZST88witwLSvpna87qpeq9K34rvVKg65BE5q"}]},"_npmUser":{"name":"souporserious","email":"ftntravis@gmail.com"},"directories":{},"maintainers":[{"name":"souporserious","email":"ftntravis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/screenshot_0.3.3_1774324356469_0.8776566649941664"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-19T20:29:18.976Z","modified":"2026-03-24T03:52:36.932Z","0.1.0":"2025-12-19T20:29:19.322Z","0.1.1":"2026-01-06T09:44:37.469Z","0.2.0":"2026-01-08T23:19:08.981Z","0.3.0":"2026-01-10T09:16:41.696Z","0.3.1":"2026-02-07T00:10:06.459Z","0.3.2":"2026-02-12T06:51:42.319Z","0.3.3":"2026-03-24T03:52:36.620Z"},"bugs":{"url":"https://github.com/souporserious/renoun/issues"},"author":{"name":"souporserious"},"license":"MIT","homepage":"https://renoun.dev","keywords":["screenshot","image","capture","canvas","html"],"repository":{"type":"git","url":"git+https://github.com/souporserious/renoun.git","directory":"packages/screenshot"},"description":"Screenshot DOM elements as a canvas, blob, or URL.","maintainers":[{"name":"souporserious","email":"ftntravis@gmail.com"}],"readme":"# @renoun/screenshot\n\nA client-side library for rendering HTML elements to canvas. Captures DOM elements with full CSS support including gradients, transforms, shadows, filters, and more.\n\n```ts\nimport { screenshot } from '@renoun/screenshot'\n\nconst canvas = await screenshot('body')\n```\n\n## Installation\n\n```bash\nnpm install @renoun/screenshot\n```\n\n## Features\n\n- CSS gradients (linear, radial, conic)\n- Box shadows and text shadows\n- Border radius and borders\n- CSS transforms including 3D with perspective\n- Backdrop filters\n- Clip paths\n- CSS masks\n- Text decorations\n- Form controls\n- SVG elements\n- Fixed position elements\n- High-DPI rendering\n- Ignore elements via a configurable selector\n\n## Usage\n\n### Convenience Methods\n\nThe simplest way to capture screenshots:\n\n```ts\nimport { screenshot } from '@renoun/screenshot'\n\n// Render to canvas\nconst canvas = await screenshot.canvas(element, { scale: 2 })\n\n// Render and encode to Blob\nconst blob = await screenshot.blob(element, {\n  format: 'jpeg',\n  quality: 0.92,\n})\n\n// Render and create an object URL (for <img src>)\nconst url = await screenshot.url(element, { format: 'png' })\n// Revoke when done\nURL.revokeObjectURL(url)\n```\n\n### Handle Pattern\n\nFor advanced use cases where you want to render once and encode multiple ways:\n\n```ts\nimport { screenshot } from '@renoun/screenshot'\n\nconst shot = screenshot(element, {\n  includeFixed: 'intersecting',\n  scale: window.devicePixelRatio,\n})\n\n// Reuse the same render for multiple encodings\nconst canvas = await shot.canvas()\nconst pngBlob = await shot.blob({ format: 'png' })\nconst webpUrl = await shot.url({ format: 'webp', quality: 0.9 })\n```\n\n### CSS Selector Support\n\nYou can pass a CSS selector instead of an element:\n\n```ts\nconst blob = await screenshot.blob('#my-element', { format: 'png' })\n```\n\n### UI Preview Pattern\n\nWhen updating previews in a UI, remember to revoke old URLs:\n\n```ts\nlet lastUrl: string | null = null\n\nasync function updatePreview() {\n  if (lastUrl) URL.revokeObjectURL(lastUrl)\n  lastUrl = await screenshot.url(element, { format: 'png' })\n  img.src = lastUrl\n}\n```\n\n### Ignoring Elements\n\nTo skip elements from the rendered output, add the `data-screenshot-ignore` attribute:\n\n```html\n<button data-screenshot-ignore>Download</button>\n```\n\nYou can also customize the ignore selector via options:\n\n```ts\nawait screenshot(element, { ignoreSelector: 'input' })\n```\n\n## API\n\n### `screenshot(target, options?)`\n\nCreates a `ScreenshotTask` that renders the element once and provides methods to access the result in different formats.\n\n**Returns:** `ScreenshotTask` - A promise-like object with additional methods.\n\n### `screenshot.canvas(target, options?)`\n\nOne-shot method to render directly to a canvas.\n\n**Returns:** `Promise<HTMLCanvasElement>`\n\n### `screenshot.blob(target, options?)`\n\nOne-shot method to render and encode to a Blob.\n\n**Returns:** `Promise<Blob>`\n\n### `screenshot.url(target, options?)`\n\nOne-shot method to render and create an object URL.\n\n**Returns:** `Promise<string>` - Remember to call `URL.revokeObjectURL()` when done.\n\n## Types\n\n```typescript\ntype ImageFormat = 'png' | 'jpeg' | 'webp'\n\ninterface RenderOptions {\n  /** Canvas background color. Set to `null` for transparent. */\n  backgroundColor?: string | null\n\n  /** Optional existing canvas to render into. */\n  canvas?: HTMLCanvasElement\n\n  /** Rendering scale factor. Defaults to `window.devicePixelRatio`. */\n  scale?: number\n\n  /** Crop origin X (CSS pixels) relative to the element. */\n  x?: number\n\n  /** Crop origin Y (CSS pixels) relative to the element. */\n  y?: number\n\n  /** Output width in CSS pixels. Defaults to element width. */\n  width?: number\n\n  /** Output height in CSS pixels. Defaults to element height. */\n  height?: number\n\n  /**\n   * Controls how `position: fixed` elements are handled.\n   * - `none` – ignore fixed elements outside the target.\n   * - `intersecting` – include fixed elements that intersect the capture rect.\n   * - `all` – include all fixed elements in the viewport.\n   */\n  includeFixed?: 'none' | 'intersecting' | 'all'\n\n  /**\n   * CSS selector used to skip elements from rendering.\n   * Defaults to `[data-screenshot-ignore]`. Set to `null` or an empty string\n   * to disable selector-based skipping.\n   */\n  ignoreSelector?: string | null\n}\n\ninterface EncodeOptions {\n  /** Image format. Defaults to 'png'. */\n  format?: ImageFormat\n\n  /** Quality for jpeg/webp (0-1). Defaults to 0.92. */\n  quality?: number\n}\n\ntype ScreenshotOptions = RenderOptions & EncodeOptions\n\ninterface ScreenshotTask extends Promise<HTMLCanvasElement> {\n  canvas(): Promise<HTMLCanvasElement>\n  blob(options?: EncodeOptions): Promise<Blob>\n  url(options?: EncodeOptions): Promise<string>\n}\n```\n\n## Canvas Security\n\nInline `<canvas>` elements are captured at screenshot start so animated and WebGL\ncontent stays stable during async resource preparation.\n\nIf a source canvas has been tainted by cross-origin image data or WebGL textures,\nthe browser will refuse to copy its pixels. In that case `@renoun/screenshot`\nrenders the element box with a visible placeholder and logs a warning instead of\nsilently leaving the area blank.\n\nTo keep canvas content readable:\n\n- Load source images with CORS enabled.\n- Set `crossOrigin=\"anonymous\"` on images before assigning `src`.\n- Ensure the image response includes a matching `Access-Control-Allow-Origin`\n  header before drawing it into a canvas or uploading it into WebGL.\n\n## License\n\n[MIT](/LICENSE.md) © [souporserious](https://souporserious.com/)\n","readmeFilename":"README.md"}