-- anImage is an image object
-- theAmount is an integer, higher values sharpen more
on sharpenImage (theImage, theAmount)
theWidth = theImage.width - 1
theHeight = theImage.height - 1
newImage = theImage.duplicate()
-- the look-up table for the original image (done for speed purposes)
listX = []
listY = []
repeat with x = 0 to theWidth
repeat with y = 0 to theHeight
listY.add(theImage.getPixel(x,y))
end repeat
listX.add(listY)
listY = []
end repeat
-- draw each pixel in the new image
repeat with y1 = 2 to theHeight
repeat with x1 = 2 to theWidth
-- get the 2 pixels we need for sharpening
theColour1 = listX[x1][y1]
theColour2 = listX[x1 - 1][y1 - 1]