Hi Colin,
Image.convolve() can be used with any kernel element values. When a kernel filter has negative values, you must specify a kernel weight explicitly. For example:
var sharpen = [ 0, -1, 0,
-1, 5, -1,
0, -1, 0 ];
var view = ImageWindow.activeWindow.currentView;
with ( view )
{
beginProcess();
image.convolve( sharpen, 1.0 ); // explicit unit kernel weight
endProcess();
}
You can specify other weights, not necessarily one, depending on your filter and what you want to achieve.
Open an image and run this little script. It applies a classical sharpen filter.
Feel free to play with different kernel filters. Note that the above sharpen filter preserves flux because the sum of its elements is one.
(edited: fixed wrong filter elements)