From klayoutclaw
Loads microscope photos, optical images, or SEMs into KLayout as background overlays for design alignment. Supports pixel-size calibration via scale bars.
How this skill is triggered — by the user, by Claude, or both
Slash command
/klayoutclaw:imageThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Load reference images (JPG, PNG, BMP) into KLayout as background overlays for aligning device geometry to real microscope photos.
Load reference images (JPG, PNG, BMP) into KLayout as background overlays for aligning device geometry to real microscope photos.
create_layout first if needed)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:
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:
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:
python scripts/add_image.py ~/photos/flake.png --pixel-size 0.05 --x 100 --y 50 --center
python scripts/list_images.py
Prints a table of all loaded images with their ID, filename, position, and visibility.
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 imageslist_images.py to see loaded images, remove_image.py to clean upIf 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.
npx claudepluginhub caidish/klayoutclaw --plugin klayoutclawCaptures the current KLayout layout as a PNG image for visual inspection. Useful for viewing, screenshotting, or previewing GDS geometry.
Processes microscopy/bioimages with scikit-image: read/write, filter (Gaussian/median/LoG), segment (threshold/watershed/active contours), measure regions, detect features. SciPy/NumPy.
Fixes SVG files for KiCad PCB import by splitting compound paths with holes, correcting Illustrator DPI scale (72 to 96), and converting CSS styles to inline attributes.