Starting at square one with image processing

Brian Yennie briany at
Thu Jul 5 19:42:10 EDT 2007


imageData is a pixel-by-pixel property. Pixels are read in rows  
across and then down.

Each pixel is 4 characters long: alpha, red, green, and blue.

So for example, a white pixel would be 0,255,255,255
A black pixel would be 0,0,0,0
A red pixel: 0,255,0,0
A 50% transparent pixel: 127, red, green, blue

And so on and so forth.

Notice the black pixel - it IS a string of zeros. You might try  
changing it to a red line to illuminate the difference, but that's  
why you are seeing so many zeros!


> I'm trying to understand the rudiments of image processing in Run Rev.
> I used the RR pencil (image not graphic) to draw a horizontal line  
> and used the following script to see how the data was stored:
> on mouseUp
>   put the imagedata of img id 1003 into tData
>   repeat for each char tChar in tData
>     put chartonum(tChar) after results
>   end repeat
>   put the number of characters in results into  msg box
>   put results into field 1
> end mouseUp
> All I got for my troubles was  string of zeros.
> So I made a small png image in Photoshop (a short horizontal black  
> line) and the same script produced the following string:
> 025525525502552542540254254253025425325202542532520254253252
> Plus a long string of similar 10 element units.
> How does this represent a black line? Am I just observing the png  
> compression code? How do I get a look at data that tells me the  
> image is a black line?
> Jim
> _______________________________________________
> use-revolution mailing list
> use-revolution at
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:

More information about the Use-livecode mailing list