How did leaf-like Kallima butterflies get so good at camouflage?

Pinning down the genetics on butterfly wings.

Kallima inachus, oak leaf butterfly, on a tree with is wings shut - they are brown, veiny, and look like a leaf
Kallima inachus, or the oak leaf butterfly, showing off its leaf lookalike talents. Credit: Ed Reschke / Getty Images