'**SUMMARY**
Do an 8bit invert of the signal. What was black is now
white, what was 255 is now zero.
**PARAMETERS**
* *max* - The maximum value of a pixel in the image, usually 255.
**RETURNS**
The inverted LineScan object.
**EXAMPLE**
>>>> ls = img.getLineScan(x=10)
>>>> ls2 = ls.invert()
>>>> plt.plot(ls)
>>>> plt.plot(ls2)
>>>> plt.show()'

def invert(self, max=255):

    out = []
    for pt in self:
        out.append((255 - pt))
    retVal = LineScan(out, image=self.image, pointLoc=self.pointLoc, pt1=self.pt1, pt2=self.pt2)
    retVal._update(self)
    return retVal
