{img = Image[ BitXor[DiamondMatrix[200, 501], BoxMatrix[80, 501], DiskMatrix[20, 501]]], MorphologicalPerimeter[img]}