Log in

View Full Version : How to prevent borders from oversharpening?


zee944
1st September 2010, 19:35
Is there a way to excluse borders from sharpening? Similar trick to the "exborder" switch in LimitedSharpen()? People often just crop them off, but really I don't like to, they have valuable picture information.

What I was thinking of as a way is to duplicate or triplicate the borders. Something like "repeat line 74 in line 73" or "repeat column 9 in column 8". (The video has black bars of course.) And in the end, the cloned borders could be indeed cropped off and you'd still have the full original image.

Any ideas?

poisondeathray
1st September 2010, 23:28
Do you mean the borders of the frame ? Maybe you can crop them off , sharpen, then add the original unsharpened ones back - or another way would be to overlay() a sharpened "cropped small box" on top of the original unsharpened

or did you mean something else like edges of objects ?

Vitaliy Gorbatenko
2nd September 2010, 05:07
Function ExBorders( clip c)
{
w = c.width()
h = c.height()
vflip = c.FlipVertical()
hflip = c.FlipHorizontal()
c
stackhorizontal( hflip.crop( w-16, 0, 16, h ).addborders( 0, 16, 0, 16 ),
\ stackvertical( vflip.crop( 0, h-16, w, 16 ), c, vflip.crop( 0, 0, w, 16 ) ),
\ hflip.crop( 0, 0, 16, h ).addborders( 0, 16, 0, 16 ) )
Return last
}


ExBorders()
Your_sharper()
crop( 16, 16, -16, -16 )


OR

w = width+32
h = height+32
PointResize(w,h,-16,-16,w,h)
Your_sharper()
Crop(16,16,-16,-16)

zee944
4th September 2010, 12:51
I did mean borders of a frame. But I want to sharpen the borders too, just not oversharpen.

Thank you very much, Vitaliy. It works like a charm!