Page 1 of 1

Capturing the RBG of a sequence of pixels

Posted: Sun Jun 19, 2016 12:39 pm
by Maxiogee
I have a photograph which I wish to stylise.
I intend to replace, both vertically and horizontally, ever second pixel's color value with that o the preceding one.
Thus, the color value of the pixel at 1,1 will also be given to the pixels at 1,2 and 2,1 and 2,2>

I have expected that the script for capturing the RGB of a given pixel might be

repeat with a = 1 to 500
if a mod 2 = 1 then
repeat with b = 1 to 500
if b mod 2 = 1 then
put a & "," & b into HV
put the backgroundColor of HV into NewColor
go to card 2
set the pencolor to NewColor
choose pencil tool

and so forth.

But the "backgroundcolor" gives me an error.

Any advice?

Re: Capturing the RBG of a sequence of pixels

Posted: Sun Jun 19, 2016 3:40 pm
by Klaus
Hi Max,

dealing with image pixels is a bit more tricky than you may think, this may get you started to work with images and its RGB values:
http://lessons.livecode.com/m/4071/c/16770

BTW:

Code: Select all

...
put a & "," & b into HV
put the backgroundColor of HV into NewColor
...
Variables do not have any color properties (nor any other) 8)


Best

Klaus