Skip to content
Skills Library
Other · Tool integration

klayoutclaw:image

/klayoutclaw:image

Load a reference image (microscope photo, optical image, SEM) into KLayout as a background overlay for design alignment. Use this skill whenever the user wants to load an image, add a background image, overlay a microscope photo, import a reference picture, align to a photo, or trace over an image. Also trigger when the user says "load this image", "use this photo as reference", "overlay the microscope image", or needs to position/scale/remove background images.

Repository
klayoutclaw ↗
Licence
MIT
Last repository change
02.08.2026

Assessment and security

90/ 100Class: good
Format15 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
4
Scripts
3
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 02.08.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 3 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/add_image.py, scripts/list_images.py, scripts/remove_image.py

What it does and when to use it

Load a reference image (microscope photo, optical image, SEM) into KLayout as a background overlay for design alignment. Use this skill whenever the user wants to load an image, add a background image, overlay a microscope photo, import a reference picture, align to a photo, or trace over an image. Also trigger when the user says "load this image", "use this photo as reference", "overlay the microscope image", or needs to position/scale/remove background images.

Triggers from the description

load this imageuse this photo as referenceoverlay the microscope image
Original author description

Load a reference image (microscope photo, optical image, SEM) into KLayout as a background overlay for design alignment. Use this skill whenever the user wants to load an image, add a background image, overlay a microscope photo, import a reference picture, align to a photo, or trace over an image. Also trigger when the user says "load this image", "use this photo as reference", "overlay the microscope image", or needs to position/scale/remove background images.

How it works

  1. Prerequisites
  2. Scripts
  3. Workflow
  4. Estimating pixel-size
Original SKILL.md headings · 73 lines, 346 words
SKILL.md preview
---
name: klayoutclaw:image
description: Load a reference image (microscope photo, optical image, SEM) into KLayout as a background overlay for design alignment. Use this skill whenever the user wants to load an image, add a background image, overlay a microscope photo, import a reference picture, align to a photo, or trace over an image. Also trigger when the user says "load this image", "use this photo as reference", "overlay the microscope image", or needs to position/scale/remove background images.
---

# KLayout Image Overlay

Load reference images (JPG, PNG, BMP) into KLayout as background overlays for aligning device geometry to real microscope photos.

## Prerequisites

- KLayout running with KlayoutClaw plugin (v0.5+)
- A layout must be open (use `create_layout` first if needed)

## Scripts

### add_image.py — Load an image as background overlay

```bash
python scripts/add_image.py <filepath> [--pixel-size 0.1] [--scale-bar <um> <pixels>] [--x 0] [--y 0] [--center]
```

- `filepath` — Path to image file (JPG, PNG, BMP)
- `--pixel-size` — Microns per pixel (default: 1.0)
- `--scale-bar` — Derive pixel size from a scale bar: `<length_um> <length_pixels>`. Takes priority over `--pixel-size`.
- `--x`, `--y` — Position offset in microns (default: 0, 0)
- `--center` — Center the image at the given position (default: image corner at position)

Example — set pixel size directly:
```bash
python scripts/add_image.py ~/photos/graphene.jpg --pixel-size 0.1
```

Example — derive pixel size from a 20 um scale bar that spans 153 pixels:
```bash
python scripts/add_image.py ~/photos/graphene.jpg --scale-bar 20 153 --center
# Output: Scale bar: 20.0 um / 153.0 px = 0.1307 um/px
```

Example — load and center at a specific position:
```bash
python scripts/add_image.py ~/photos/flake.png --pixel-size 0.05 --x 100 --y 50 --center
```

### list_images.py — List all background images in the view

```bash
python scripts/list_images.py
```

Prints a table of all loaded images with their ID, filename, position, and visibility.

### remove_image.py — Remove a background image

```bash
python scripts/remove_image.py <image_id | all>
```

- `image_id` — Numeric ID of the image to remove (from `list_images.py`)
- `all` — Remove all background images

## Workflow

1. Load a microscope image as reference background
2. Use geometry scripts to draw device features (contacts, gates, mesa) on top
3. Adjust pixel-size to match the image's physical scale (check the scale bar)
4. Use `list_images.py` to see loaded images, `remove_image.py` to clean up

## Estimating pixel-size

If the image has a scale bar of length `S` microns spanning `P` pixels:
```
pixel-size = S / P
```

For example, a 20 um scale bar that spans 200 pixels gives `pixel-size = 0.1`.
Files in this package (4)
  • SKILL.md 3 KB
  • scripts/add_image.py 4 KB
  • scripts/list_images.py 1 KB
  • scripts/remove_image.py 2 KB

Versions

The database has no other skills named klayoutclaw:image.

Database snapshot: 13.11.2026 · package version dd0fb5d778c5 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 90klayoutclaw:visual
    Capture the current KLayout layout as a PNG image for visual inspection. Use this skill whenever the user wants to see, view, screenshot, preview, or visually inspect the current layout. Also trigger when the user asks "what does it look like", "show me the layout", "take a…
  • 90klayoutclaw:display
    Toggle KLayout layer visibility on and off for better visualization. Use this skill when the user wants to show/hide layers, toggle layer display, change layer visibility, or focus on specific layers in KLayout. Also trigger when the user says things like "hide the metal layer",…
  • 82image-edit
    Requires OFOX_API_KEY — create one at https://app.ofox.ai. Change one thing in an image you already have and leave the rest of the picture alone — swap the background, recolour a part, remove or add an object, clean up a photo — from a local jpeg/png/webp file. Delegates to…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.