This is such an awesome feature of RWPaint, to be able to create effects on-the-fly using JavaScript.
Here's something quick I threw together for a customizable scanline effect. Horizontal, vertical or both scanlines are possible with the scanline_x and scanline_y variables and the alpha value of the effect can be adjusted with scanline_alpha.
var img = Document.RasterImage;
var sizeX = img.sizeX;
var sizeY = img.sizeY;
var scanline_x = 2;
var scanline_y = 0;
var scanline_alpha = 0;
for (var x = 0; x < sizeX; x += 1) {
for (var y = 0; y < sizeY; y += 1) {
if (x%scanline_x === 0) {
img.SetPixelAlpha(x, y, 0, 0, scanline_alpha);
}
if (y%scanline_y === 0) {
img.SetPixelAlpha(x, y, 0, 0, scanline_alpha);
}
}
}
I also posted this up as a Gist:
https://gist.github.com/Ugotsta/6613836
Again, awesome feature. Thanks Vlasta for an incredible editor!