[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M76JKMZ7S8FKPRMCAWN43VGK":3,"skill-same:01M76JKMZ7S8FKPRMCAWN43VGK":54},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M76JKMZ7S8FKPRMCAWN43VGK","pixijs-html-source",null,"Use this skill when rendering live HTML\u002FDOM elements (or frozen snapshots of them) as PixiJS v8 textures via the EXPERIMENTAL HTML-in-Canvas browser APIs. Covers the pixi.js\u002Fhtml-source import, feature detection with canvas.requestPaint, HTMLSource for a live, repainting, still-interactive element (autoLayout\u002FautoUpdate\u002FautoRequestPaint, requestPaint, isReady, HTMLSource.defaultOptions, the direct-child-of-canvas + layoutsubtree requirement), ElementImageSource for an immutable captureElementImage() snapshot (autoClose, ready immediately), using the source on a Sprite\u002FTexture\u002FMesh, fallback-only auto-detection via Texture.from at priority -10, uploader error messages, and destroy\u002Fcleanup. Triggers on: HTMLSource, ElementImageSource, ElementImage, HTML in canvas, render DOM to texture, render HTML to texture, texElementImage2D, copyElementImageToTexture, HTMLSourceOptions, ElementImageSourceOptions, HTMLSourceCanvas.","bg-szy\u002FTOP-SKILLS","bg-szy","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F106576190?v=4","01M73A4E8KPV67SFXRY8XZGNBX","ShuZhiyong","01M73A4E96MQ294MHM74TZBVQD",6,"MIT","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fpixijs-html-source\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: pixijs-html-source\ndescription: \"Use this skill when rendering live HTML\u002FDOM elements (or frozen snapshots of them) as PixiJS v8 textures via the EXPERIMENTAL HTML-in-Canvas browser APIs. Covers the pixi.js\u002Fhtml-source import, feature detection with canvas.requestPaint, HTMLSource for a live, repainting, still-interactive element (autoLayout\u002FautoUpdate\u002FautoRequestPaint, requestPaint, isReady, HTMLSource.defaultOptions, the direct-child-of-canvas + layoutsubtree requirement), ElementImageSource for an immutable captureElementImage() snapshot (autoClose, ready immediately), using the source on a Sprite\u002FTexture\u002FMesh, fallback-only auto-detection via Texture.from at priority -10, uploader error messages, and destroy\u002Fcleanup. Triggers on: HTMLSource, ElementImageSource, ElementImage, HTML in canvas, render DOM to texture, render HTML to texture, texElementImage2D, copyElementImageToTexture, HTMLSourceOptions, ElementImageSourceOptions, HTMLSourceCanvas.\"\nlicense: MIT\n---\n\n`HTMLSource` and `ElementImageSource` turn a DOM element into a `TextureSource` you can use anywhere a normal texture works: on a `Sprite`, as a `Texture` frame, or mapped onto a `Mesh`. `HTMLSource` mirrors a live element's pixels into the GPU (the element stays editable and clickable in the browser); `ElementImageSource` wraps an immutable snapshot that never repaints. Both live in `pixi.js\u002Fhtml-source`; importing from that path registers their extensions.\n\n> These sources rely on the experimental HTML-in-Canvas browser proposal and are marked EXPERIMENTAL in PixiJS v8. The browser API must be enabled or the texture uploader throws on first render; feature-detect with `canvas.requestPaint` before relying on it. The API may change between minor releases.\n\nAssumes familiarity with `pixijs-scene-sprite` and textures. These are texture *sources*, not display objects: wrap them in a `Sprite` (or `Texture`\u002F`Mesh`) to put them on screen. Not available in Web Workers; a worker has no DOM to capture.\n\n## Quick Start\n\n```ts\nimport { Application, Sprite } from \"pixi.js\";\nimport { HTMLSource } from \"pixi.js\u002Fhtml-source\";\n\nconst app = new Application();\nawait app.init({ resizeTo: window });\ndocument.body.appendChild(app.canvas);\n\n\u002F\u002F The element must be a direct child of the Pixi canvas.\nconst form = document.createElement(\"form\");\nform.innerHTML = '\u003Cinput value=\"still editable\" \u002F>';\napp.canvas.appendChild(form);\n\n\u002F\u002F Render the live form as a sprite. It stays interactive in the browser.\nconst source = new HTMLSource({ resource: form });\nconst sprite = Sprite.from(source);\n\nsprite.anchor.set(0.5);\nsprite.position.set(app.screen.width \u002F 2, app.screen.height \u002F 2);\napp.stage.addChild(sprite);\n```\n\n**Related skills:** `pixijs-scene-sprite` (display the texture), `pixijs-scene-mesh` (map onto geometry, `PerspectiveMesh`), `pixijs-scene-dom-container` (the opposite: overlay HTML *above* the canvas, outside the GPU pipeline), `pixijs-assets` (texture sources vs the loader\u002Fcache), `pixijs-environments` (no DOM in Web Workers).\n\n## Constructor options\n\nBoth sources extend `TextureSource`, so all `TextureSourceOptions` (`resolution`, `scaleMode`, `addressMode`, `label`, etc.) are valid. `resource` is required on each.\n\n`HTMLSourceOptions` (live element):\n\n| Option             | Type               | Default | Description                                                                                                                                              |\n| ------------------ | ------------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `resource`         | `Element`          | —       | Required. The live DOM element to render. Must be a direct child of the owning canvas, or the constructor throws.                                         |\n| `canvas`           | `HTMLSourceCanvas` | —       | The canvas that owns the element's layout subtree. Inferred from `resource.parentElement` when the element is a direct canvas child; pass it when inference is not possible. |\n| `autoLayout`       | `boolean`          | `true`  | Set the `layoutsubtree` attribute on the owning canvas. The browser only lays out and paints canvas children when it is present. Set `false` if you write `\u003Ccanvas layoutsubtree>` yourself. |\n| `autoUpdate`       | `boolean`          | `true`  | Listen for the canvas `paint` event and re-upload when the element repaints. Set `false` for a static, captured-once texture.                             |\n| `autoRequestPaint` | `boolean`          | `true`  | Request one initial paint after construction. Set `false` and call `source.requestPaint()` yourself each frame for continuous animation.                  |\n\n`ElementImageSourceOptions` (immutable snapshot):\n\n| Option       | Type           | Default | Description                                                                                                                            |\n| ------------ | -------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------- |\n| `resource`   | `ElementImage` | —       | Required. A snapshot from `canvas.captureElementImage(element)`.                                                                        |\n| `autoClose`  | `boolean`      | `false` | Call `snapshot.close()` when the source is destroyed. Leave `false` when the snapshot is shared with other sources, or you risk a use-after-free. |\n\nChange the defaults for every `HTMLSource` through the static `HTMLSource.defaultOptions` object, for example `HTMLSource.defaultOptions.autoUpdate = false`.\n\n## Core Patterns\n\n### Setup and the side-effect import\n\n```ts\nimport \"pixi.js\u002Fhtml-source\";\nimport { HTMLSource, ElementImageSource } from \"pixi.js\u002Fhtml-source\";\n```\n\n`pixi.js\u002Fhtml-source` calls `extensions.add(...)` to register `HTMLSource`, `ElementImageSource`, and their WebGL\u002FWebGPU uploaders. Without it, the renderer has no `'html'` uploader and these sources never render. The classes are exported from `pixi.js\u002Fhtml-source`, not `pixi.js`.\n\nImporting a named export from `pixi.js\u002Fhtml-source` also triggers the side effect, so a bare `import 'pixi.js\u002Fhtml-source'` is only needed when you don't import anything else from that path.\n\n### Feature detection and browser support\n\nThe HTML-in-Canvas API is gated behind a browser flag. Feature-detect before relying on it:\n\n```ts\nimport type { HTMLSourceCanvas } from \"pixi.js\u002Fhtml-source\";\n\nconst canvas = app.canvas as HTMLSourceCanvas;\n\nif (canvas.requestPaint) {\n  \u002F\u002F HTML-in-Canvas is available.\n}\n```\n\nCast `app.canvas` to `HTMLSourceCanvas` for the typed `requestPaint` and `captureElementImage` members. `source.requestPaint()` returns `false` when the browser lacks the API; the texture uploader throws on first render when it is disabled.\n\nWhen the API is missing the first upload throws `[HTMLSource] WebGLRenderingContext.texElementImage2D is not available...` on WebGL or `[HTMLSource] GPUQueue.copyElementImageToTexture is not available...` on WebGPU.\n\n### Live element with HTMLSource\n\n```ts\nconst form = document.createElement(\"form\");\napp.canvas.appendChild(form); \u002F\u002F direct child of the canvas\n\nconst source = new HTMLSource({ resource: form });\nconst sprite = Sprite.from(source);\n```\n\nThe element must be a direct child of the renderer's `\u003Ccanvas>`; the source infers the owning canvas from `resource.parentElement` (or pass `canvas`). With the defaults, it sets `layoutsubtree` on the canvas, listens for the canvas `paint` event, and requests one initial paint. `source.isReady` is `false` until that first paint lands, then `true`. It is `true` immediately when `autoUpdate` is `false`. `resourceWidth`\u002F`resourceHeight` report the element's real-pixel size (`offsetWidth`\u002F`offsetHeight`).\n\n### Continuous animation with requestPaint\n\n```ts\nconst source = new HTMLSource({ resource: clock, autoRequestPaint: false });\nconst sprite = Sprite.from(source);\n\napp.ticker.add(() => {\n  clock.textContent = new Date().toLocaleTimeString();\n  source.requestPaint(); \u002F\u002F re-snapshot the DOM this frame\n});\n```\n\nThe browser only repaints canvas children on demand. For an element whose content changes every frame, set `autoRequestPaint: false` and call `source.requestPaint()` in your own ticker to drive repaints on your schedule.\n\n### Immutable snapshot with ElementImageSource\n\n```ts\nimport { ElementImageSource } from \"pixi.js\u002Fhtml-source\";\nimport type { HTMLSourceCanvas } from \"pixi.js\u002Fhtml-source\";\n\nconst canvas = app.canvas as HTMLSourceCanvas;\nconst snapshot = canvas.captureElementImage!(element);\n\nconst source = new ElementImageSource({ resource: snapshot, autoClose: true });\nconst sprite = Sprite.from(source);\n```\n\n`captureElementImage()` freezes an element's current pixels into an immutable `ElementImage`. There is no owning canvas, no `paint` listener, and no repaint lifecycle, so the source is ready the moment it is constructed. Reach for it when you need a frozen copy that outlives its element or is transferred around (transitions, \"shatter\" or trail effects). Release the snapshot with `snapshot.close()` when done, or pass `autoClose: true` to let the source close it on `destroy()`.\n\n### Using the source on a sprite, texture, or mesh\n\nBoth sources are normal `TextureSource`s. Wrap them with `Sprite.from(source)` \u002F `Texture.from(source)`, frame or slice them into sub-textures, or map them onto a mesh:\n\n```ts\nimport { Rectangle, Texture } from \"pixi.js\";\n\n\u002F\u002F A 64x64 slice of the rendered element.\nconst chunk = new Texture({\n  source,\n  frame: new Rectangle(0, 0, 64, 64),\n});\n\n\u002F\u002F Mapped onto geometry (e.g. a perspective warp).\nconst mesh = new PerspectiveMesh({ texture: Texture.from(source) \u002F* ... *\u002F });\n```\n\n### Auto-detection and priority\n\n```ts\n\u002F\u002F Resolves to an HTMLSource (element) or ElementImageSource (snapshot) only as a last resort.\nconst sprite = Sprite.from(elementAlreadyInTheCanvas);\n```\n\nA generic HTML element or an `ElementImage` passed to `Texture.from`\u002F`Sprite.from` resolves to these sources at the lowest texture-source priority (`-10`), so they only claim a resource no other built-in source handles. Image, video, and canvas elements are deliberately rejected; they have dedicated, faster sources. Construct the source explicitly when you need options (`autoUpdate`, `autoClose`) or non-HTML elements such as SVG.\n\n## Common Mistakes\n\n### [HIGH] Importing from pixi.js instead of pixi.js\u002Fhtml-source\n\nWrong:\n\n```ts\nimport { HTMLSource } from \"pixi.js\"; \u002F\u002F not exported from the core entry\n```\n\nCorrect:\n\n```ts\nimport { HTMLSource } from \"pixi.js\u002Fhtml-source\";\n```\n\n`HTMLSource`, `ElementImageSource`, and the `'html'` uploaders live only in `pixi.js\u002Fhtml-source`. Importing anything from that path registers the extensions; the module is marked side-effectful, so bundlers keep the registration even when you only import a class.\n\n### [HIGH] Assuming the browser API is enabled\n\nThe HTML-in-Canvas proposal is not shipped by default. If the API is disabled, the uploader throws on first render. Feature-detect first:\n\n```ts\nconst canvas = app.canvas as HTMLSourceCanvas;\nif (!canvas.requestPaint) {\n  \u002F\u002F Fall back to a static image, DOMContainer overlay, or a message.\n}\n```\n\n### [MEDIUM] Element not a direct child of the canvas\n\n```ts\ndocument.body.appendChild(form); \u002F\u002F wrong parent\nconst source = new HTMLSource({ resource: form }); \u002F\u002F throws\n```\n\n`HTMLSource` requires the element to be a direct child of the owning canvas (`app.canvas.appendChild(form)`) and throws otherwise. Append the element to the canvas before constructing the source, or pass the `canvas` option.\n\n### [MEDIUM] Expecting a live element to update without requestPaint\n\nA non-animating element updates automatically on browser `paint` events (`autoUpdate: true`). Content that changes every frame will not re-upload unless something triggers a paint; drive it with `source.requestPaint()` each frame (with `autoRequestPaint: false`).\n\n### [MEDIUM] Closing an ElementImage still in use\n\n```ts\nconst source = new ElementImageSource({ resource: snapshot, autoClose: true });\nconst other = new ElementImageSource({ resource: snapshot }); \u002F\u002F shares the snapshot\n\nsource.destroy(); \u002F\u002F closes the snapshot — `other` is now a use-after-free\n```\n\nOnly set `autoClose: true` when the source owns the snapshot exclusively. For a shared snapshot, leave `autoClose` off and call `snapshot.close()` once, after the last source is destroyed.\n\n## Cleanup\n\n```ts\nsource.destroy();\n```\n\n`HTMLSource.destroy()` detaches the canvas `paint` listener and nulls its canvas reference. `ElementImageSource.destroy()` closes the snapshot when `autoClose` was set; otherwise call `snapshot.close()` yourself to release the memory.\n\n## API Reference\n\n- [HTMLSource](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Frendering.HTMLSource.html.md)\n- [HTMLSourceOptions](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Frendering.HTMLSourceOptions.html.md)\n- [ElementImageSource](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Frendering.ElementImageSource.html.md)\n- [ElementImageSourceOptions](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Frendering.ElementImageSourceOptions.html.md)\n- [HTMLSourceCanvas](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Frendering.HTMLSourceCanvas.html.md)\n- [ElementImage](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Frendering.ElementImage.html.md)\n","`HTMLSource` and `ElementImageSource` turn a DOM element into a `TextureSource` you can use anywhere a normal texture works: on a `Sprite`, as a `Texture` frame, or mapped onto a `Mesh`. `HTMLSource` mirrors a live element's pixels into the GPU (the element stays editable and clickable in the browser); `ElementImageSource` wraps an immutable snapshot that never repaints. Both live in `pixi.js\u002Fhtml-source`; importing from that path registers their extensions.\n\n> These sources rely on the experimental HTML-in-Canvas browser proposal and are marked EXPERIMENTAL in PixiJS v8. The browser API must be enabled or the texture uploader throws on first render; feature-detect with `canvas.requestPaint` before relying on it. The API may change between minor releases.\n\nAssumes familiarity with `pixijs-scene-sprite` and textures. These are texture *sources*, not display objects: wrap them in a `Sprite` (or `Texture`\u002F`Mesh`) to put them on screen. Not available in Web Workers; a worker has no DOM to capture.\n\n## Quick Start\n\n```ts\nimport { Application, Sprite } from \"pixi.js\";\nimport { HTMLSource } from \"pixi.js\u002Fhtml-source\";\n\nconst app = new Application();\nawait app.init({ resizeTo: window });\ndocument.body.appendChild(app.canvas);\n\n\u002F\u002F The element must be a direct child of the Pixi canvas.\nconst form = document.createElement(\"form\");\nform.innerHTML = '\u003Cinput value=\"still editable\" \u002F>';\napp.canvas.appendChild(form);\n\n\u002F\u002F Render the live form as a sprite. It stays interactive in the browser.\nconst source = new HTMLSource({ resource: form });\nconst sprite = Sprite.from(source);\n\nsprite.anchor.set(0.5);\nsprite.position.set(app.screen.width \u002F 2, app.screen.height \u002F 2);\napp.stage.addChild(sprite);\n```\n\n**Related skills:** `pixijs-scene-sprite` (display the texture), `pixijs-scene-mesh` (map onto geometry, `PerspectiveMesh`), `pixijs-scene-dom-container` (the opposite: overlay HTML *above* the canvas, outside the GPU pipeline), `pixijs-assets` (texture sources vs the loader\u002Fcache), `pixijs-environments` (no DOM in Web Workers).\n\n## Constructor options\n\nBoth sources extend `TextureSource`, so all `TextureSourceOptions` (`resolution`, `scaleMode`, `addressMode`, `label`, etc.) are valid. `resource` is required on each.\n\n`HTMLSourceOptions` (live element):\n\n| Option             | Type               | Default | Description                                                                                                                                              |\n| ------------------ | ------------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `resource`         | `Element`          | —       | Required. The live DOM element to render. Must be a direct child of the owning canvas, or the constructor throws.                                         |\n| `canvas`           | `HTMLSourceCanvas` | —       | The canvas that owns the element's layout subtree. Inferred from `resource.parentElement` when the element is a direct canvas child; pass it when inference is not possible. |\n| `autoLayout`       | `boolean`          | `true`  | Set the `layoutsubtree` attribute on the owning canvas. The browser only lays out and paints canvas children when it is present. Set `false` if you write `\u003Ccanvas layoutsubtree>` yourself. |\n| `autoUpdate`       | `boolean`          | `true`  | Listen for the canvas `paint` event and re-upload when the element repaints. Set `false` for a static, captured-once texture.                             |\n| `autoRequestPaint` | `boolean`          | `true`  | Request one initial paint after construction. Set `false` and call `source.requestPaint()` yourself each frame for continuous animation.                  |\n\n`ElementImageSourceOptions` (immutable snapshot):\n\n| Option       | Type           | Default | Description                                                                                                                            |\n| ------------ | -------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------- |\n| `resource`   | `ElementImage` | —       | Required. A snapshot from `canvas.captureElementImage(element)`.                                                                        |\n| `autoClose`  | `boolean`      | `false` | Call `snapshot.close()` when the source is destroyed. Leave `false` when the snapshot is shared with other sources, or you risk a use-after-free. |\n\nChange the defaults for every `HTMLSource` through the static `HTMLSource.defaultOptions` object, for example `HTMLSource.defaultOptions.autoUpdate = false`.\n\n## Core Patterns\n\n### Setup and the side-effect import\n\n```ts\nimport \"pixi.js\u002Fhtml-source\";\nimport { HTMLSource, ElementImageSource } from \"pixi.js\u002Fhtml-source\";\n```\n\n`pixi.js\u002Fhtml-source` calls `extensions.add(...)` to register `HTMLSource`, `ElementImageSource`, and their WebGL\u002FWebGPU uploaders. Without it, the renderer has no `'html'` uploader and these sources never render. The classes are exported from `pixi.js\u002Fhtml-source`, not `pixi.js`.\n\nImporting a named export from `pixi.js\u002Fhtml-source` also triggers the side effect, so a bare `import 'pixi.js\u002Fhtml-source'` is only needed when you don't import anything else from that path.\n\n### Feature detection and browser support\n\nThe HTML-in-Canvas API is gated behind a browser flag. Feature-detect before relying on it:\n\n```ts\nimport type { HTMLSourceCanvas } from \"pixi.js\u002Fhtml-source\";\n\nconst canvas = app.canvas as HTMLSourceCanvas;\n\nif (canvas.requestPaint) {\n  \u002F\u002F HTML-in-Canvas is available.\n}\n```\n\nCast `app.canvas` to `HTMLSourceCanvas` for the typed `requestPaint` and `captureElementImage` members. `source.requestPaint()` returns `false` when the browser lacks the API; the texture uploader throws on first render when it is disabled.\n\nWhen the API is missing the first upload throws `[HTMLSource] WebGLRenderingContext.texElementImage2D is not available...` on WebGL or `[HTMLSource] GPUQueue.copyElementImageToTexture is not available...` on WebGPU.\n\n### Live element with HTMLSource\n\n```ts\nconst form = document.createElement(\"form\");\napp.canvas.appendChild(form); \u002F\u002F direct child of the canvas\n\nconst source = new HTMLSource({ resource: form });\nconst sprite = Sprite.from(source);\n```\n\nThe element must be a direct child of the renderer's `\u003Ccanvas>`; the source infers the owning canvas from `resource.parentElement` (or pass `canvas`). With the defaults, it sets `layoutsubtree` on the canvas, listens for the canvas `paint` event, and requests one initial paint. `source.isReady` is `false` until that first paint lands, then `true`. It is `true` immediately when `autoUpdate` is `false`. `resourceWidth`\u002F`resourceHeight` report the element's real-pixel size (`offsetWidth`\u002F`offsetHeight`).\n\n### Continuous animation with requestPaint\n\n```ts\nconst source = new HTMLSource({ resource: clock, autoRequestPaint: false });\nconst sprite = Sprite.from(source);\n\napp.ticker.add(() => {\n  clock.textContent = new Date().toLocaleTimeString();\n  source.requestPaint(); \u002F\u002F re-snapshot the DOM this frame\n});\n```\n\nThe browser only repaints canvas children on demand. For an element whose content changes every frame, set `autoRequestPaint: false` and call `source.requestPaint()` in your own ticker to drive repaints on your schedule.\n\n### Immutable snapshot with ElementImageSource\n\n```ts\nimport { ElementImageSource } from \"pixi.js\u002Fhtml-source\";\nimport type { HTMLSourceCanvas } from \"pixi.js\u002Fhtml-source\";\n\nconst canvas = app.canvas as HTMLSourceCanvas;\nconst snapshot = canvas.captureElementImage!(element);\n\nconst source = new ElementImageSource({ resource: snapshot, autoClose: true });\nconst sprite = Sprite.from(source);\n```\n\n`captureElementImage()` freezes an element's current pixels into an immutable `ElementImage`. There is no owning canvas, no `paint` listener, and no repaint lifecycle, so the source is ready the moment it is constructed. Reach for it when you need a frozen copy that outlives its element or is transferred around (transitions, \"shatter\" or trail effects). Release the snapshot with `snapshot.close()` when done, or pass `autoClose: true` to let the source close it on `destroy()`.\n\n### Using the source on a sprite, texture, or mesh\n\nBoth sources are normal `TextureSource`s. Wrap them with `Sprite.from(source)` \u002F `Texture.from(source)`, frame or slice them into sub-textures, or map them onto a mesh:\n\n```ts\nimport { Rectangle, Texture } from \"pixi.js\";\n\n\u002F\u002F A 64x64 slice of the rendered element.\nconst chunk = new Texture({\n  source,\n  frame: new Rectangle(0, 0, 64, 64),\n});\n\n\u002F\u002F Mapped onto geometry (e.g. a perspective warp).\nconst mesh = new PerspectiveMesh({ texture: Texture.from(source) \u002F* ... *\u002F });\n```\n\n### Auto-detection and priority\n\n```ts\n\u002F\u002F Resolves to an HTMLSource (element) or ElementImageSource (snapshot) only as a last resort.\nconst sprite = Sprite.from(elementAlreadyInTheCanvas);\n```\n\nA generic HTML element or an `ElementImage` passed to `Texture.from`\u002F`Sprite.from` resolves to these sources at the lowest texture-source priority (`-10`), so they only claim a resource no other built-in source handles. Image, video, and canvas elements are deliberately rejected; they have dedicated, faster sources. Construct the source explicitly when you need options (`autoUpdate`, `autoClose`) or non-HTML elements such as SVG.\n\n## Common Mistakes\n\n### [HIGH] Importing from pixi.js instead of pixi.js\u002Fhtml-source\n\nWrong:\n\n```ts\nimport { HTMLSource } from \"pixi.js\"; \u002F\u002F not exported from the core entry\n```\n\nCorrect:\n\n```ts\nimport { HTMLSource } from \"pixi.js\u002Fhtml-source\";\n```\n\n`HTMLSource`, `ElementImageSource`, and the `'html'` uploaders live only in `pixi.js\u002Fhtml-source`. Importing anything from that path registers the extensions; the module is marked side-effectful, so bundlers keep the registration even when you only import a class.\n\n### [HIGH] Assuming the browser API is enabled\n\nThe HTML-in-Canvas proposal is not shipped by default. If the API is disabled, the uploader throws on first render. Feature-detect first:\n\n```ts\nconst canvas = app.canvas as HTMLSourceCanvas;\nif (!canvas.requestPaint) {\n  \u002F\u002F Fall back to a static image, DOMContainer overlay, or a message.\n}\n```\n\n### [MEDIUM] Element not a direct child of the canvas\n\n```ts\ndocument.body.appendChild(form); \u002F\u002F wrong parent\nconst source = new HTMLSource({ resource: form }); \u002F\u002F throws\n```\n\n`HTMLSource` requires the element to be a direct child of the owning canvas (`app.canvas.appendChild(form)`) and throws otherwise. Append the element to the canvas before constructing the source, or pass the `canvas` option.\n\n### [MEDIUM] Expecting a live element to update without requestPaint\n\nA non-animating element updates automatically on browser `paint` events (`autoUpdate: true`). Content that changes every frame will not re-upload unless something triggers a paint; drive it with `source.requestPaint()` each frame (with `autoRequestPaint: false`).\n\n### [MEDIUM] Closing an ElementImage still in use\n\n```ts\nconst source = new ElementImageSource({ resource: snapshot, autoClose: true });\nconst other = new ElementImageSource({ resource: snapshot }); \u002F\u002F shares the snapshot\n\nsource.destroy(); \u002F\u002F closes the snapshot — `other` is now a use-after-free\n```\n\nOnly set `autoClose: true` when the source owns the snapshot exclusively. For a shared snapshot, leave `autoClose` off and call `snapshot.close()` once, after the last source is destroyed.\n\n## Cleanup\n\n```ts\nsource.destroy();\n```\n\n`HTMLSource.destroy()` detaches the canvas `paint` listener and nulls its canvas reference. `ElementImageSource.destroy()` closes the snapshot when `autoClose` was set; otherwise call `snapshot.close()` yourself to release the memory.\n\n## API Reference\n\n- [HTMLSource](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Frendering.HTMLSource.html.md)\n- [HTMLSourceOptions](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Frendering.HTMLSourceOptions.html.md)\n- [ElementImageSource](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Frendering.ElementImageSource.html.md)\n- [ElementImageSourceOptions](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Frendering.ElementImageSourceOptions.html.md)\n- [HTMLSourceCanvas](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Frendering.HTMLSourceCanvas.html.md)\n- [ElementImage](https:\u002F\u002Fpixijs.download\u002Frelease\u002Fdocs\u002Frendering.ElementImage.html.md)\n",{"name":5,"license":15,"description":7},"master","fd76f882a04e445e899d5cfb2732f2105ea054ee","skills\u002Fmarketplace\u002Fpixijs-html-source",0,"https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS","https:\u002F\u002Fbg-szy.github.io\u002FTOP-SKILLS\u002F","https:\u002F\u002Fgithub.com\u002Fbg-szy","https:\u002F\u002Fwww.ecust.edu.cn\u002F","a student of East China University of Science and Technology","2026-11-15 03:38:02",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add bg-szy\u002FTOP-SKILLS --skill pixijs-html-source",{"tool":40,"command":41},"bunx","bunx skills add bg-szy\u002FTOP-SKILLS --skill pixijs-html-source",{"tool":43,"command":44},"pnpm","pnpm dlx skills add bg-szy\u002FTOP-SKILLS --skill pixijs-html-source","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fpixijs-html-source\u002FSKILL.md",true,[48],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"skill-report.json","REFERENCE","参考文档",61728,"https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fpixijs-html-source\u002Fskill-report.json",[55,63,70,77,84,91],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":62},"01M7DXW9N826PKXK174PVW3038","serpmaven","Scrape Google search results (SERP) to JSON with SERP Maven (serpmaven) - a real Chrome browser on a residential proxy with sticky sessions. Run it as a CLI, a Python library, a local HTTP search API (`serve`), an MCP server or a Docker image; set the proxy login, workers, pages and cost tracking. Use when the user wants Google results, rank tracking, a self-hosted SERP API, or live Google search for an AI agent.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fserpmaven\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":62},"01M7DXVHSTWDV65475QEQ915M7","revnu-landing-page-audit","Find out why a landing page isn't turning visitors into signups, demos or sales. Audits one page against what the ad, post or search that sends people there promised, then checks the first screen, proof, call to action, friction and mobile. Returns at most 7 prioritized fixes, plus what is fine and what could not be checked; rewrites specific lines and fixes the page in the repo when asked. Never promises a conversion lift. Works without a Revnu account. Use when the user says or asks: \"audit my landing page\", \"why isn't this page converting\", \"review my homepage\", \"my ads get clicks but no signups\", \"people bounce from the pricing page\", \"CRO review\", \"improve conversion rate\", \"is my hero section clear\", \"roast my landing page\", \"rewrite my headline\", \"what's wrong with this page\", \"landing page feedback\", \"make the signup page convert better\". Not for SEO or AI-search audits, page speed engineering on its own, or building a new page from scratch.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-landing-page-audit\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":62},"01M7DXV8X2D7B3VTD4HHYYHTGR","revnu-growth-context","Write down once who buys, what they're stuck on, what it costs, what proof you have and what you've already tried, so every growth task starts from facts instead of a questionnaire. Creates or updates .agents\u002Frevnu-growth.md from the repo, the live site and the user, and imports an existing product-marketing.md. Use when the user says \"set up our marketing context\", \"who is our ideal customer\", \"write our ICP\", \"describe the product for marketing\", \"positioning doc\", \"what's our brand voice\", \"remember this about our customers\", \"log what we tried\", \"what have we learned from marketing\", \"we changed pricing, update the context\", \"update our growth notes\", \"summarize the business for the agent\", \"import my product-marketing.md\", \"start a growth doc\", or before a first marketing, SEO, outreach or launch task when no context file exists. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-growth-context\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":62},"01M7DXV0DGJ1G0A60PAHC6J3C5","revnu-get-listed","Get onto the third-party pages AI answers and search cite when buyers ask for the best tool in your category: \"best X\" roundups, directories, review sites, GitHub awesome lists, community threads and comparison pages. Finds which ones are cited, ranks them by fit and effort, and drafts each submission, PR or pitch by the target's own rules. Use when the user says \"get us listed\", \"which directories should we submit to\", \"how do we get into best-of lists\", \"why does ChatGPT recommend competitors and not us\", \"get mentioned in AI answers\", \"submit to awesome lists\", \"get on G2\", \"where are our competitors listed\", \"pitch listicle authors\", \"find backlink opportunities\", \"launch directories\", \"get into roundups\", \"Product Hunt alternatives\", \"where should we be listed\", \"get cited by Perplexity\". Never submits, pays or posts without a yes. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-get-listed\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":62},"01M7DXTSPMGT9D6DSS0HP9BSTA","revnu-ai-readiness-audit","Audit whether your website gives ChatGPT, Perplexity, Claude, Gemini and Google's AI Overviews something worth quoting, and fix the pages that don't. Use when the user says or asks \"is my site ready for AI search\", \"audit my site for AI answers\", \"AEO audit\", \"GEO audit\", \"why doesn't ChatGPT quote our pricing\", \"make our pages citable by AI\", \"do I need llms.txt\", \"does schema help with ChatGPT\", \"check our structured data\", \"is our content visible without JavaScript\", \"AI SEO audit\", \"optimize our homepage for AI answers\", \"LLM SEO check\", \"why does AI get our product wrong\", \"fix our site for AI Overviews\". Checks fetchability and indexability, answers in the raw HTML, entity facts, schema (including JS-injected markup), headings, dates and llms.txt, then gives at most 10 prioritised fixes and edits the repo when asked. Works without a Revnu account.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Frevnu-ai-readiness-audit\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":62},"01M7DXSZHCVTRS620GC3S97JZV","proxy-troubleshooting","Diagnose residential proxy failures, with NodeMaven's gateway as the reference - 407 with correct credentials, 406, 410, 500, a connection that hangs, ERR_TUNNEL_CONNECTION_FAILED in a browser, Playwright or Puppeteer ignoring proxy credentials, a sticky session that changes IP, geo-targeting that is silently ignored, passwords with special characters, and unexpected traffic from headless Chrome. Use when a proxy connection fails, returns the wrong location, or costs more traffic than expected.","https:\u002F\u002Fgithub.com\u002Fbg-szy\u002FTOP-SKILLS\u002Fblob\u002Fmaster\u002Fskills\u002Fmarketplace\u002Fproxy-troubleshooting\u002FSKILL.md",[],[]]