Skip to content

Instantly share code, notes, and snippets.

@R3V1Z3
Created September 18, 2013 18:57
Show Gist options
  • Save R3V1Z3/6613836 to your computer and use it in GitHub Desktop.
Save R3V1Z3/6613836 to your computer and use it in GitHub Desktop.
Simple scanline effect for RealWorld Paint, usable as a layer style or effect via the JavaScript layer style or custom operation effect. The effect can be horizontal, vertical or both using 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);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment