View Raw SPL

/* invert the colors of an image */
iminvert(w = refwindow(w0))
{
        local r, g, b, a, img;

        /* rgb and alpha components */
        (r, g, b, a) = getrgb(w);

        img = rgbimage(1 - r, 1 - g, 1 - b, a);

        return(img);

}