Formalizing image extraction