Physics-Based Image Generation

Physics-based image generation

← Back to Notebook Examples

notebooks/physics_based_image_generation/example_physics_based.ipynb

Builds synthetic electrochemical microscopy images by drawing physics-inspired particle blobs and cracks onto a real background image, using spice.shape_based.<method>(). Covers: starting a drawing session on a loaded background with spice.shape_based.create(); smoothing it with apply_gaussian_smoothing(); adding round, Gaussian-intensity particles with generate_gaussian_circles() (you choose how many, their size, and how much they overlap/blend); drawing wavy, crack-like lines with generate_wiggly_cracks(); and viewing the finished image next to the mask of everything drawn onto it. A final section shows generate_sequence() — which produces a whole animated sequence of moving particles as one dataset_type='multiple_frames' SPICEData. Every step is recorded automatically in spice.history.