Widget usage example #2d: LC-ImageToolBox_v175
Comes in two variants
(uses Canvas2D in a browser widget which works on Mac/Win/linux with LC 8/9)
(uses Canvas2D in revBrowser which works on Mac only with LC 6/7/8/9)
Version 1.7.5 adds a new feature to LC-ImageToolBox:
(using a square around each pixel of up to 15x15).
An x-Quantile is a generalized parameter of location of distributions with a percentage x.
We have for example
-- the minimum of the sample values with x=0,
-- the quartiles at 25% or 50% or 75% with x=25 or 50 or 75,
-- the median of the sample values with x=50,
-- the maximum of the sample values with x=100.
You can select a 'collecting' square of 3x3, 5x5, 7x7, ..., 15x15 pixels.
For each image pixel the distribution of the color values of the r,g,b-channels of all pixels of that square around it is computed.
Then the r,g,b-values of the pixel are replaced by the r,g,b-quantiles of that distribution.
So there is a lot to compute, for example for x=50, a 9x9 square and an image of size 1000x700 we need 3x1000x700 = 2,100,000 times the median of 81 collected color values.
On a medium fast machine (Mac mini 2.5 GHz/IntelHD Graphics4000), my algorithm does this in
-- 1200 ms with LC 9.0, using the LC-ImageToolBox_89
-- 2200 ms with LC 6.7, using the LC-ImageToolBox_6789Mac
Download LC-ImageToolBox89_v175 from "Sample Stacks" or using http://livecodeshare.runrev.com/stack/826/
Download LC-ImageToolBox6789Mac_v175 from "Sample Stacks" or using http://livecodeshare.runrev.com/stack/827/