Created
September 18, 2013 18:57
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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