From klayoutclaw
Loads reference images (JPG, PNG, BMP) into KLayout as background overlays for aligning designs to microscope photos. Supports pixel-size scaling, scale-bar derivation, positioning, listing, and removal via Python scripts.
npx claudepluginhub caidish/klayoutclaw --plugin klayoutclawThis skill uses the workspace's default tool permissions.
Load reference images (JPG, PNG, BMP) into KLayout as background overlays for aligning device geometry to real microscope photos.
Captures current KLayout layout as PNG image and GDS file using gdstk, matplotlib, and numpy for visual inspection of geometry. Provides file paths for direct viewing.
Processes microscopy and bioimage images with scikit-image: read/write, filter (Gaussian, median, LoG), segment (thresholding, watershed, active contours), measure regions, detect features. NumPy/SciPy integration.
Generates and edits images using OpenAI gpt-image-2 via CLI, Claude Code skill, and prompt gallery with 162 curated prompts for UI mockups, research figures, photography.
Share bugs, ideas, or general feedback.
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.