which in the case of the item access operator are __getitem__()__setitem__()and __delitem__(the image class uses html-style hexadecimal strings to represent colors the background color must be set when the image is createdotherwiseit defaults to white the image class saves and loads images in its own custom formatbut it can also export in the xpm format which is understood by many image processing applications the xpm image produced by the code snippet is shown in figure figure the square_eye xpm image we will now review the image class' methodsstarting with the class line and the initializerclass imagedef __init__(selfwidthheightfilename=""background="#ffffff")self filename filename self __background background self __data {self __width width self __height height self __colors {self __backgroundwhen an image is createdthe user ( the class' usermust provide width and heightbut the filename and background color are optional since defaults are provided the self __data dictionary' keys are (xycoordinates and its values are color strings the self __colors set is initialized with the background colorit is used to keep track of the unique colors used by the image all the data attributes are private except for the filenameso we must provide means by which users of the class can access them this is easily done using properties @property def background(self)return self __background in we will see completely different approach to providing attribute accessusing special methods such as __getattr__(and __setattr__()that is useful in some circumstances