With 10 million pixels, comparing 3 different base colors (RGB), and checking both upper and lower bounds, that comes to 60 million comparisons. That is an awful lot for a scripted environment.
You would need to make an external (and, frankly, the LC instructions on making desktop externals do not work for modern versions of LC and Visual Studio). For a project, I was able to successfully use ImageMagick as a command line image processor. It took a few seconds, but much better than what LC took. ImageMagick is pretty flexible and might give you what you need. I was using it for green screen image extractions. Sent from my iPhone > On Mar 18, 2017, at 2:20 PM, Peter Reid via use-livecode > <use-livecode@lists.runrev.com> wrote: > > I've got an app that allows the user to display an image using a variable > number of colours (2-24 colours). In addition, the user can specify upper > and lower thresholds so that all pixels below a specified value are displayed > using a colour such as black and all pixels with values above a specified > value are displayed using a colour such as red. Pixels with values between > the thresholds are displayed using the specified colour range of 2-24 > colours. The images can consist of up to 8-10 million pixels, they are > rectangular and can be in a landscape or portrait orientation. > > Whilst I have this working the code that manages the changing of the number > and use of colours in an image is rather slow. This is despite me using the > "repeat for each" loop structure and lock the screen wherever possible to get > the maximum speed! > > Does anyone have any clever algorithms, code, add-ons, etc. that can do this > kind of thing in a flash?! > > Thanks > > Peter > -- > Peter Reid > Loughborough, UK > > > _______________________________________________ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode