Solarize - RealWorld forums

Log-in or register.

Solarize

PAEz
on October 28th 2013

Solarize

Code
Execution

var image = Document.RasterImage;

var w = image.sizeX;
var h = image.sizeY;
var c,r,g,b,a,x,y;

for (x=0; x<w; x++){
for (y=0; y<h; y++){

c = image.GetPixel(x,y,0,0);

b = c & 255;
g = c >> 8 & 255;
r = c >> 16 & 255;
a = c >> 24 & 255;


if (r > 127) r = 255 - r;
if (g > 127) g = 255 - g;
if (b > 127) b = 255 - b;

c=(a << 24) |
  (r << 16) |
  (g <<  8) |
   b;

image.SetPixel(x, y, 0, 0, c);

}
}

Source
Pixtastic
http://www.pixastic.com/
http://www.pixastic.com/lib/git/pixastic/actions/solarize.js

Page views: 922       Posts: 1      
I wish there were...
Vista & Win 7 icons
What about ICL files?