We associate a half-integer number, called the quantum index, to algebraic curves in the real plane satisfying to certain conditions. The area encompassed by the logarithmic image of such curves is equal to π2 times the quantum index of the curve, and thus has a discrete spectrum of values. We use the quantum index to refine enumeration of real rational curves in a way consistent with the Block–Göttsche invariants from tropical enumerative geometry.