giszzt/figedit
Convert raster figures into high-fidelity editable SVG and native PowerPoint packages. Use for screenshots, paper figures, workflow diagrams, architecture diagrams, infographics, UI schematics, charts/maps, posters, covers, and image-heavy technical figures when labels, formulas, structure, source-specific assets, and complex continuous backgrounds must be reconstructed with useful editability.
npx skills add https://github.com/giszzt/figedit --skill figedit
Use this skill to rebuild a non-editable raster figure as a high-fidelity editable graphics package. It keeps the base FigEdit workflow as the default, and adds one extra decision gate for complex continuous backgrounds.
The goal is not "vectorize everything," "crop everything," or "send everything to AI." Route each part of the source image to the representation that preserves both fidelity and useful editability:
math elements and editable PowerPoint equationsimage elementsOpenCV and OCR evidence can guide measurements and validation, but they do not decide what enters the final SVG. Do not dump all OpenCV candidates, OCR boxes, or draft-manifest objects into the final package.
Run every command from the user's project directory, not from the skill folder. Create one task directory per figure in the user's workspace, and write all intermediates and outputs there. Never write run artifacts back into the skill directory.
The examples below use figure-task/work for evidence and figure-task/out for the final package.
Run:
python scripts/prepare_measurements.py input.png --out figure-task/work
Use forward slashes in all script arguments; trailing backslashes are swallowed by some shells.
This creates:
ocr_results.jsondetected_primitives.jsonstyle_tokens.jsondraft_manifest.jsonmeasurement_report.mddiagnostics/ocr_overlay.pngdiagnostics/structure_overlay.pngdiagnostics/style_overlay.pngassets/source.*Treat these files as evidence only.
OCR defaults to PaddleOCR's PP-OCRv6 medium profile when available. Use smaller profiles for fast drafts, not for final small-text review. OCR is never ground truth: verify high-confidence confusions, code tokens, CJK near-neighbor characters, and formula symbols against the source.
Inspect the source image and diagnostics before authoring the manifest. Classify the semantic figure route first; do not choose an AI background route merely because the image is visually dense, and do not reject it merely because the background could be redrawn by a skilled illustrator. The question is whether FigEdit can reconstruct it reliably from simple SVG primitives and clean source crops.
math reconstruction, with source-bbox and baseline constraints so formulas remain visually aligned after SVG and PPTX export.Reference loading is route-based:
references/manifest_spec.md, references/svg_authoring.md, and references/quality_checklist.md.references/taxonomy.md and references/workflow.md.references/formula-reconstruction.md.references/element_decision_matrix.md, references/asset_preservation_policy.md, and references/asset_extraction.md.regenerate-chroma (contaminated, entangled, or continuous-background elements), read references/chroma_regeneration.md and references/image_backend_policy.md.references/background_reconstruction.md.ai-clean-plate, also read references/ai_clean_plate_prompting.md and references/image_backend_policy.md.Author the manifest by deciding every significant element through these gates. These rules are peers; none is a universal first step.
Redraw structural elements as editable SVG shapes:
Use OpenCV coordinates as measurement hints, not as automatic truth. Reject detector-only texture lines, compression edges, false arrowheads, duplicate hatching, and raw contour noise.
Retype readable labels, titles, captions, legends, axis labels, callouts, and ordinary annotations as SVG text. Use OCR only as candidate evidence. Mark uncertain text in the manifest; do not accept OCR fallback text merely because it exists.
For dense paper figures, architecture diagrams, and formula-heavy composites, text placement is part of the reconstruction, not a cosmetic pass. Record or infer the source region, line breaks, alignment anchor, and baseline for small labels before writing the final text element. A label is not complete just because the characters are correct; it must fit the same visual slot without colliding with boxes, arrows, formulas, or neighboring labels in both SVG preview and native PPTX.
Mathematical formulas are first-class semantic objects. Author equations, inequalities, fractions, sums, Greek symbols, scripts, recurrences, and inline math spans as math elements with normalized LaTeX, never as formula strings inside type: "text".
For mixed prose/formula regions, split the prose into text and the formula span into a separate adjacent math element. Before finalizing, scan text elements for formula cues and repair leaks.
Formula editability is a core requirement. Do not solve formula density by cropping equations as images or by leaving formula-like strings as plain text. The correct repair for a misplaced editable formula is better measurement and layout control: source bounding box, width/height, font size, anchor, baseline, and local collision checks.
Treat PPTX formula export as a two-part requirement:
If PowerPoint's equation layout changes the formula size, baseline, or spacing, adjust the manifest and rerun composition. Do not mark the result complete merely because editable.pptx.math_report.json shows a successful conversion.
Crop source-specific raster visuals as assets. This includes pictorial icons, logos, application/model marks, screenshots, maps, chart bodies, thumbnails, photos, UI fragments, avatars, robots, hand-drawn props, document/folder graphics, and dense visual examples.
Do not replace source-specific visual objects with generic invented SVG. Redraw only when the object is a clearly generic primitive or the user explicitly requests editable vectorization. When uncertain, crop.
How a raster asset is obtained depends on the route, and there are exactly two methods — no salient-object matting anywhere. The route sets the default method; the user's explicit request can send any individual asset to either method (e.g. regenerate a crop-eligible asset for cleaner edges, or keep a crop the user prefers):
crop_assets.py from the manifest's source_region), keeping surrounding labels, frames, and arrows editable. Do not drag unrelated background, old labels, callout lines, or neighboring objects into the crop. The asset is placed as a rectangular image; assets on flat/white/simple backgrounds need no alpha at all. This is the default for screenshots, chart bodies, maps, logos on flat fields, and any figure whose assets sit on a separable background.ai-clean-plate with full-extract/selective, the foreground is not cropped from the original at all. A reference-capable image model reproduces the in-scope elements on a solid chroma sheet chosen by probe_palette.py; chroma_key.py + slice_grid.py then separate each element as a clean transparent PNG. This "generate a clean foreground sheet, then key it apart" path is the only way in-scope objects become transparent assets on this route. Record decision: "regenerate-chroma", asset_fidelity: "approximate-ok", and generation_provenance.Anything can be AI-regenerated — photos, people, illustrations, icons, badges, logos, screenshots, charts, maps, composite objects — with no content-category approval gate; quality is a function of the model and prompt, so hard cases call for a sharper preserve-the-element prompt, not a refusal. Put the whole foreground inventory on one sheet (chroma_regeneration.md) and only split when the model visibly cannot fit or resolve them all; regenerate each distinct element once and place repeats by shared asset_id. Never improvise GrabCut/difference/threshold/rembg matting scripts to separate objects from a natural background — on the AI route the sheet background is already flat and keys exactly; on the conventional route a rectangle crop is enough.
Apply this gate after the structure, text, formula, and asset gates have claimed everything they can faithfully represent. It answers one question:
Can the base FigEdit hybrid route, using clean source crops plus simple deterministic SVG primitives, faithfully reconstruct the background field without asking the model to invent or hand-paint scene pixels?
background_plan unless the user explicitly requests the AI route. Redraw structure and text as SVG, crop source-specific visuals as raster assets, and mix them panel-by-panel. This is the default for regular paper figures, workflow diagrams, architecture diagrams, white/light-background diagrams, charts, maps, UI screenshots, and cleanly framed visual assets whose background is flat, regular, or mechanically reproducible.ai-clean-plate. Use this when foreground text, labels, leader lines, markers, or icons are embedded in a continuous photograph, illustration, rendering, texture, irregular/multi-zone gradient, scene-like infographic, magazine-cover field, poster scene, or technical scene where crop + simple SVG cannot reveal or reproduce the hidden pixels.The gate decides the default; an explicit route request in the user's own words overrides it in either direction — a user may send a regular figure to ai-clean-plate for extraction precision, or keep a scene figure conventional after hearing the fidelity cost. Record route_decision.source: "user-directive" and keep the full quality bar (see User Route Directive in references/background_reconstruction.md).
This gate is about background recoverability, not content category, visual density, or genre. Do not count hand-recreating a scene as faithful SVG reconstruction; approximate SVG scenery is a redesign, not a high-fidelity rebuild. The authoritative definition of this gate — the recoverability test, the strong-signal list, and the foreground policy after an accepted plate — is references/background_reconstruction.md; read it whenever the answer is not obviously "yes".
For ai-clean-plate, the clean plate is a complete non-editable visual bottom layer. It must be an edit of the source that removes the foreground-to-rebuild and reconstructs the pixels behind it, while keeping the original background otherwise unchanged — same tone, gradient/haze zones, texture, star/grain density, lighting, and structure as the source. It is not a fresh scene: a plate that resynthesizes the background into a visibly different field (different haze placement, different star pattern density, restyled colors) is a redesign and must be rejected and regenerated, even though behind-foreground fill inevitably differs pixel-for-pixel. Overlay editable text, math, and simple marks on top. Under full-extract/selective, in-scope pictorial objects come back as transparent assets from the generated foreground sheet (never as source rectangle crops); under flatten they stay in the plate. Prefer a clean flattened plate over a patchwork of dirty source crops.
Before generating the plate, make the Foreground Depth Decision (background_reconstruction.md): full-extract (all pictorial objects become independent assets), selective (user-named subset), or flatten (objects stay in the plate). The modes need different plates, so decide first. This is a hard checkpoint: unless the user's own words state a depth preference, stop and present the options — inventory, what each mode buys, relative cost and time, plus your recommendation — before any generation call. The figure's characteristics inform the recommendation, never a silent choice. Record the mode and its origin in background_plan.foreground_mode / foreground_mode_source.
If ai-clean-plate is selected but no reference-capable image backend is available or accepted, stop and report the blocker. Do not silently downgrade to a conventional reconstruction, keep the untouched source as the plate, or fake a clean plate with local blur/clone/inpaint scripts.
Do panel-by-panel semantic decomposition. Do not crop a whole panel merely because it is dense, and do not redraw a whole panel merely because the structure is regular. Split each panel by function:
mathLayer carefully:
layer: background.layer: assets.layer: panels with fill: none.layer: icons — it is drawn after panels, while layer: assets is drawn before and would be hidden by any filled panel.layer: connectors.layer: texts.Draw order is background → assets → panels → sections → icons → connectors → texts → annotations. Do not draw a filled panel rectangle above an image asset; it will hide the asset in the preview.
Run:
python scripts/compose_svg_package.py manifest.json --out figure-task/out
This creates:
editable.svgeditable_embedded.svgeditable.pptxpreview.pngmanifest.jsoncontact_sheet.pngquality_report.mdeditability_report.mdassets/diagnostics/placement_overlay.pngdiagnostics/visual_qa/ (side_by_side, blend, diff_heatmap, per-tile scores)The PPTX is a native DrawingML export. Prefer it when the user needs to edit the figure in PowerPoint. By default, the export uses semantic top-level ungrouping: layer/layout groups are flattened so text, shapes, connectors, and cropped assets can be selected directly, while formulas, masks, filters, rotations, and explicitly atomic groups remain grouped for fidelity.
PowerPoint can reflow text boxes and Office Math differently from the SVG preview. This is expected and must be validated. For formula-heavy or small-text-dense figures, inspect the exported PPTX or a PPTX-rendered preview before delivery and repair any formula/text drift, overflow, baseline shift, or collision.
Inspect:
preview.pngcontact_sheet.pngeditable.pptx when PowerPoint editability is requestedquality_report.mdeditability_report.mddiagnostics/placement_overlay.pngdiagnostics/visual_qa/diff_heatmap.png and the worst-tile scores in quality_report.md (report-only: high-difference tiles are review triggers, not automatic failures)chroma_key reports when regenerate-chroma is usedai-clean-plate is usedRepair against references/quality_checklist.md before delivery; its High-Priority Failure Conditions section is the authoritative list. The most frequent blockers: missing panels or wrong arrows, detector/OCR noise in the final SVG, editable content baked into rasters, formula-like text not split into math, source-specific visuals replaced by generic redraws or missing entirely (Assets: 0 without a documented reason), clipped or contaminated crops, clean-plate results patched with dirty source crops, and PPTX exports whose math or tight text has not been visually checked.
manifest.json.OpenCV candidates are never automatically final. They must be accepted, merged, ignored, or replaced by the model-authored manifest.
Image generation is used after the Background Gate selects ai-clean-plate, or when the user's own words request an AI generation route. It creates an accepted clean visual plate from the source image and the model-authored preserve/remove/reconstruct brief.
Before touching any scriptable backend, inventory your own tools: if the agent environment has any built-in image generation/editing tool (Codex image_gen, a bundled image tool, an image MCP), use it first. Built-in tools take the reference image from the visible conversation context, not from parameters: display the source image into the conversation (e.g. view_image) so it becomes the edit target, then invoke the tool with a prompt that names the just-displayed image as the sole edit target, and collect the output from the tool's save location (Codex: ~/.codex/generated_images/<session>/). A parameter schema without reference-image or output-path options is normal for built-in tools and is never a reason to skip them; the full protocol is in references/image_backend_policy.md. Only when the built-in tool is genuinely absent or an actual invocation fails, fall through the scriptable order in that file: Labnana GPT-Image-2 first, Labnana Gemini/Nano Banana second, then official OpenAI/Gemini APIs or a configured command adapter. A positive --precheck only means scriptable fallbacks exist; it is not permission to skip the built-in tool. Backend adapters execute the brief; they do not decide the figure route or foreground asset strategy.
Acceptable output preserves all information from the source (titles, labels, panels, arrows, source-specific visuals), keeps ordinary text and every detected formula editable in both SVG and native PPTX, holds their placement after PPTX reflow, and contains no detector noise, no formula-text leakage, and no editable content baked into rasters. For AI clean plate, the deliverable is a clean visual plate plus an editable foreground overlay, never a patchwork of source blocks. The full acceptance dimensions live in references/quality_checklist.md.
Use scripts/audit_editability.py manifest.json after composing. Treat these as review triggers:
0.45 when OCR evidence is availabletext_policy: reviewRead reference files according to the route and element gates:
references/manifest_spec.md: manifest field reference. Use for every task.references/svg_authoring.md: SVG authoring conventions, layering, and fonts. Use for every task.references/quality_checklist.md: validation checklist before delivery. Use for every task.references/workflow.md: detailed end-to-end reconstruction workflow. Read for complex, unfamiliar, or mixed-route figures.references/taxonomy.md: figure classification and reconstruction modes. Read before deciding the reconstruction approach for an unfamiliar figure type.references/formula-reconstruction.md: full math element schema and inline-math splitting rules. Required when formulas or inline math appear.references/element_decision_matrix.md: element-level redraw vs crop vs retype decisions. Required when the figure contains both editable structure and non-structural visual objects.references/asset_preservation_policy.md: rules for preserving source visual objects as raster assets. Required when the figure contains icons, logos, screenshots, thumbnails, pictorial objects, maps, chart bodies, or source-specific marks.references/asset_extraction.md: cropping and asset boundary verification rules. Required when assets are needed or when deciding whether raster/source-specific visuals can be safely redrawn.references/background_reconstruction.md: Background Gate and AI clean-plate foreground policy. Read when a continuous visual field may be unrecoverable by crop + SVG.references/ai_clean_plate_prompting.md: dynamic prompt framework. Required only when ai-clean-plate is selected.references/image_backend_policy.md: environment-neutral image backend policy. Required only when image generation is needed.references/chroma_regeneration.md: regenerate-then-key pipeline for contaminated or entangled assets. Required when any asset routes to regenerate-chroma.references/contaminated_asset_recovery.md: recovery decisions for assets overlapped by labels, leader lines, or neighbors. Read when a wanted asset cannot be cropped cleanly.references/text_layer_policy.md: text handling over continuous visual fields. Read when the source has formulas, code, or dense text sitting on a scene or plate.scripts/prepare_measurements.py: OCR/CV/style evidence only.scripts/compose_svg_package.py: compose a package from a model-authored manifest.scripts/crop_assets.py: coordinate-crop rectangular assets from the source using each asset's source_region; the conventional-route asset method.scripts/probe_palette.py: pick a chroma-key color guaranteed far from the source palette, per regeneration sheet.scripts/chroma_key.py: key a solid chroma background out of a regenerated sheet; decontaminates edges, cast shadows, and enclosed holes; reports edge quality.scripts/slice_grid.py: slice a keyed sheet into individual transparent assets by connected components, absorbing small detached parts.scripts/visual_compare_qa.py: pixel-level source-vs-preview comparison (side-by-side, blend, diff heatmap, worst tiles); compose runs it automatically as a report-only gate.scripts/export_pptx_from_svg.py: export editable.svg to native PPTX.scripts/pptx_math.py: convert manifest LaTeX to editable PPTX Office Math.scripts/formula_text_detection.py: detect formula-like content left in text elements.scripts/svg_to_pptx/: bundled SVG-to-DrawingML converter used for PPTX output.scripts/svg_finalize/flatten_tspan.py: bundled text-layout helper for PPTX-safe multi-line SVG text.scripts/pptx_animations.py: bundled optional transition/animation XML helpers used by the PPTX converter.scripts/audit_editability.py: audit text lift ratio, asset text risk, and SVG editability.scripts/detect_ocr_paddle.py: PaddleOCR adapter.scripts/detect_primitives_cv.py: OpenCV diagnostics.scripts/sample_styles.py: color/style sampling.scripts/infer_assets.py: experimental asset inference utilities.scripts/generate_diagnostics.py: diagnostic overlays.scripts/quality_audit.py: XML/render/report checks plus route-appropriate review gates.scripts/validate_manifest.py: manifest validation.scripts/generate_clean_plate.py: optional reference-capable image backend adapter. Use only after the model has selected ai-clean-plate and written the prompt brief.scripts/prepare_clean_plate_mask.py: optional mask/overlay preparation for image-generation prompts. It does not create a final clean plate.build_svg_from_manifest.py, embed_svg_assets.py, math_renderer.py, and api_keys.py are internal helpers imported by the scripts above; do not run them directly.
Automate YouTube tasks via Rube MCP (Composio): upload videos, manage playlists, search content, get analytics, and handle comments. Always search tools first for current schemas.
This skill should be used when comparing two videos to analyze compression results or quality differences. Generates interactive HTML reports with quality metrics (PSNR, SSIM) and frame-by-frame visual comparisons. Triggers when users mention "compare videos", "video quality", "compression analysis", "before/after compression", or request quality assessment of compressed videos.
Python bridge to ImageJ2/Fiji for macros, plugins (Bio-Formats, TrackMate, Analyze Particles), NumPy↔ImagePlus/ImgLib2 exchange, and ImageJ Ops. Automates Fiji headlessly from Python. Use scikit-image for pure Python without Fiji plugins; napari for visualization.
Create 3D scenes, interactive experiences, and visual effects using Three.js. Use when user requests 3D graphics, WebGL experiences, 3D visualizations, animations, or interactive 3D elements.
Create and audit truthful, accessible, publication-ready scientific figures with Matplotlib, Seaborn, or Plotly. Use for figure design, multi-panel layouts, uncertainty and missing-data displays, color/contrast review, image metadata validation, and journal export planning.
Generate publication-quality PNG chart images from data, supporting line, bar, area, candlestick, pie, and heatmap charts. Triggers when the user asks to visualize data, create a graph, plot a time series, or generate a chart for a report, alert, or dashboard. Runs as a lightweight, headless Node.js process without a browser.
Performs deep Root Cause Analysis (RCA) on NVIDIA TAO Visual ChangeNet classification experiments with image-evidence-driven investigation. Use when analyzing ChangeNet model failures, investigating poor recall / FAR / PASS-NO_PASS metrics, auditing visual inspection pipeline quality, or running an RCA report for an AOI defect-detection model. Trigger phrases include "RCA on my ChangeNet model", "why is my AOI model failing", "audit ChangeNet predictions", "investigate FAR regressions", "root cause analysis on visual-changenet".
Build 3D web apps with Three.js (WebGL/WebGPU). Use for 3D scenes, animations, custom shaders, PBR materials, VR/XR experiences, games, data visualizations, product configurators.
Take giszzt/figedit from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.