Quantitative metallography to understand the morphology of different crystallographic phases in a material often rests on the segmentation and classification of electron backscatter diffraction (EBSD) maps. Image analysis offers rich toolboxes to perform such tasks based on `scalar' images. Embracing the entire wealth of information provided by crystallography, operations such as erosion, dilation, interpolation, smoothing and segmentation require generalizations to do justice to the very nature of crystal orientations (e.g. preserving properties like frame indifference). The present study gives such extensions based on quaternion representation of crystal orientations. A dual-phase stainless steel specimen is used to illustrate the different steps of such a procedure.