Surface.applyColorFX
From Spheriki
Applies a ColorMatrix to a surface.
Usage
Apply the colormatrix to the pixels contained in between x,y (marking the top-left corner) and w (width) and h (height).
Examples
// Swap red and blue color matrix
var cm = CreateColorMatrix(0, 0,0,255, 0, 0,255,0, 0, 255,0,0);
// Load a surface from an image
var surf = LoadSurface("picture.png");
// Modify the colours of that image
surf.applyColorFX(0, 0, surf.width, surf.height, cm);
// Save image back to disk
surf.save("modifiedpicture.png");
For more examples see CreateColorMatrix
See also
- Surface.applyColorFX()
- Surface.applyColorFX4()
- Surface.applyLookup()