The ommatidium of the butterfly's afocal apposition eye exhibits angular performance that can only be achieved by transforming the diffraction pattern of its corneal lens into the fundamental mode of its rhabdom waveguide. A graded index model of the ommatidium has been proposed and verified but the efforts to extract the transformation's underlying physics from it have been hindered by its extreme complexity. Here we numerically investigate the ommatidium model and reveal that the current model, involving only the graded index distribution, is insufficient for the transformation. We further find that adding spatially varying absorption to the existing model dramatically improves its transformation performance, producing near-perfect mode matching with overlap integral exceeding 0.96. Such a combined action of spatially varying index and absorption for microscale mode transformation is new to researchers in optics and biology and will benefit both disciplines.