Fast method for counting RGB values of an image

Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Fast method for counting RGB values of an image

Post by capellan » Mon Feb 10, 2020 2:32 am

Just for curiosity, Could a LC Builder function works faster than Javascript?
I don't know how to use LC Builder so I could not test myself...

Al

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Fast method for counting RGB values of an image

Post by [-hh] » Mon Feb 10, 2020 4:19 am

With accessing single bytes of imageData it is even slower than LC Script...
shiftLock happens

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Fast method for counting RGB values of an image

Post by capellan » Mon Feb 10, 2020 8:40 pm

Oh... Then if we put the imagedata in a variable,
and use LCB to make the conversion of binary data
this is still slower than LCS. :shock:

When is LCB faster than LCS?

Al

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Fast method for counting RGB values of an image

Post by [-hh] » Mon Feb 10, 2020 9:00 pm

Related to images LCB is at least as fast as LCS when drawing rectangular blocks of images and is faster with deliberate affine transforms of images.
Moreover LCB has features that you don't have in LCS, e.g. (sub-pixel) drawing of affine transformed pathes, especially SVG Pathes.
LCB is still far apart from but on the way to deliver the excellent HTML5 canvas operations.
shiftLock happens

Post Reply

Return to “Multimedia”