  A numerical technique for calculating effective actions of electromagnetic
backgrounds is proposed, which is based on the string-inspired worldline
formalism. As examples, we consider scalar electrodynamics in three and four
dimensions to one-loop order. Beyond the constant-magnetic-field case, we
analyze a step-function-like magnetic field exhibiting a nonlocal and
nonperturbative phenomenon: ``magnetic-field diffusion''. Finally,
generalizations to fermionic loops and systems at finite temperature are
discussed.
