-- maximumSharpen_Luminance.lua -- search for maximum luminance difference and replace current pixel -- with pixel having max lum difference -- author: Sinisa Petric, (pixopedia@sigmapi-design.com), 2008 image_OUT = 0 image_INP = 1 size = 2 function maxlumdiff (x,y, size) local i, j, x_pos, y_pos, lum, lum_max, lum_center x_pos, y_pos = x, y lum_max = 0 lum_center = fp24_getImageLuminance01(image_INP, x, y) for i=-size,size do for j=-size,size do lum = math.abs(fp24_getImageLuminance01(image_INP, x+j, y+i) - lum_center) if lum > lum_max then lum_max = lum x_pos, y_pos = x + j, y + i end end end return x_pos, y_pos end for y=0, vp24_height-1 do for x= 0, vp24_width-1 do new_x, new_y = maxlumdiff(x, y, size) r, g, b = fp24_getImageRGB(image_INP, new_x, new_y) fp24_setImageRGB (image_OUT, x, y, r, g, b) end fp24_showProgress (y, vp24_height) end