Re: Colour Manipulation
Now this is also available, very fast, with the same speed, for LC 6/7/8/9 on Mac using Canvas2d in a revBrowser instance (on Win revBrowser doesn't support Canvas2d) in LC-ImageToolBox-67: Basics. Get it via "Sample Stacks" of the LC-Toolbar or from http://livecodeshare.runrev.com/stack/827/LCImageToolBox67%3A-Basics-v102 Somehow I missed the possibility of LC 6/7's revBrowser to use Canvas2D on Mac until now, the gain in speed compared to 'ordinary' LCScript is terrific. Just try in LC 7! It was Jonathan's transform-demo for the browser widget that opened my eyes. Thanks again for that example, Jonathan. There's still a fast working solution for linux missing and for Raspi (which sadly inherits the linux bugs with web browssing). Within the next weeks I will publish LC-ImageToolBox-JIT for that (uses luaJIT), I have it already running. > hh wrote: > Today I implemented this as part of LC-ImageToolBox-89: Basics. > Get it _from LC 8/9_ via "Sample Stacks" of the LC-Toolbar or from > > http://livecodeshare.runrev.com/stack/826/LC-ImageToolBox89%3A-Basics-v102 > > Uses Canvas2D (no webGL because of issues with some graphic cards) > in a hidden browser widget. Your method gives nice Effects and works > with a decent graphic card pretty fast. Needs here with LC 8/9 on a > Mac mini 2.5 GHz/IntelHD4000 for a 1920x1080 image < 500 millisecs. > >> Peter R. 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?! ___ 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
Re: Colour Manipulation
Hi all. Today I implemented this as part of LCImageToolBox89: Basics. Get it _from LC 8/9_ via "Sample Stacks" of the LC-Toolbar or http://livecodeshare.runrev.com/stack/826/LC-ImageToolBox89%3A-Basics Uses Canvas2D (no webGL because of issues with some graphic cards) in a hidden browser widget. Your method gives nice Effects and works with a decent graphic card pretty fast. Needs here with LC 8/9 on a Mac mini 2.5 GHz/IntelHD4000 for a 1920x1080 image < 500 millisecs. ___ 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
Re: Colour Manipulation
Yes I agree wholeheartedly with Johnathan - I once (maybe five years ago) wanted to use ImageMagick but was put off, partly because I wanted to put it into a commercial product and couldn’t understanding the licensing rules: in particular, it seemed that I had to give all my users (purchasers) access to IM somehow, including the source code… I could never understand how to do this cleanly. That, and the (to me) astonishingly hard to use interface, coupled with zero support, made me think the whole thing was a non-starter. I wonder what people think now. By “people” I mean those of us who really don’t want to step at all far out of the LiveCode comfort zone, even to do a bit of command-line tweaking. Oh, and want their solutions cross-platform. Graham > On 19 Mar 2017, at 04:48, Jonathan Lynch via use-livecode > wrote: > > It would be amazing if the LC folks created an ImageMagick wrapper so that we > could use it as an external or widget! > > Sent from my iPhone > >> On Mar 18, 2017, at 11:30 PM, Mike Bonner via use-livecode >> wrote: >> >> You could write a small app just to do the processing (or use a web server >> with an lc script to process) break it into chunks, and spawn >> processes/server requests to offload the work maybe. Though imagemagick >> would be a pretty awesome solution if it can be made to do what you need. >> >> On Sat, Mar 18, 2017 at 4:02 PM, Jonathan Lynch via use-livecode < >> use-livecode@lists.runrev.com> wrote: >> >>> You could put the entire ImageMagick set of files into custom properties, >>> then, when your app first opens, look to see if ImageMagick is present. If >>> not, then have your app save the ImageMagick files in the same folder as >>> your app. >>> >>> I have done that sort of thing before - big files, but works fine. >>> >>> If you can find a Javascipt library that does what you need, your mission >>> would be easy :) >>> >>> Sent from my iPhone >>> On Mar 18, 2017, at 5:03 PM, jonathandly...@gmail.com wrote: 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 >>> >> ___ >> 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 > pre
Re: Colour Manipulation
> Jonathan L. wrote: > It would be amazing if the LC folks created an ImageMagick wrapper so that > we could use it as an external or widget! There is a Java interface (JMagick, see https://www.imagemagick.org/script/api.php) and the brand-new LiveCode FFI for Java. > If you can find a Javascript library that does what you need, your mission > would be easy :) You can handle imagedata in HTML5/canvas2D very similar to LiveCode or use webGL. ___ 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
Re: Colour Manipulation
It would be amazing if the LC folks created an ImageMagick wrapper so that we could use it as an external or widget! Sent from my iPhone > On Mar 18, 2017, at 11:30 PM, Mike Bonner via use-livecode > wrote: > > You could write a small app just to do the processing (or use a web server > with an lc script to process) break it into chunks, and spawn > processes/server requests to offload the work maybe. Though imagemagick > would be a pretty awesome solution if it can be made to do what you need. > > On Sat, Mar 18, 2017 at 4:02 PM, Jonathan Lynch via use-livecode < > use-livecode@lists.runrev.com> wrote: > >> You could put the entire ImageMagick set of files into custom properties, >> then, when your app first opens, look to see if ImageMagick is present. If >> not, then have your app save the ImageMagick files in the same folder as >> your app. >> >> I have done that sort of thing before - big files, but works fine. >> >> If you can find a Javascipt library that does what you need, your mission >> would be easy :) >> >> Sent from my iPhone >> >>> On Mar 18, 2017, at 5:03 PM, jonathandly...@gmail.com wrote: >>> >>> 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 >> > ___ > 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
Re: Colour Manipulation
You could write a small app just to do the processing (or use a web server with an lc script to process) break it into chunks, and spawn processes/server requests to offload the work maybe. Though imagemagick would be a pretty awesome solution if it can be made to do what you need. On Sat, Mar 18, 2017 at 4:02 PM, Jonathan Lynch via use-livecode < use-livecode@lists.runrev.com> wrote: > You could put the entire ImageMagick set of files into custom properties, > then, when your app first opens, look to see if ImageMagick is present. If > not, then have your app save the ImageMagick files in the same folder as > your app. > > I have done that sort of thing before - big files, but works fine. > > If you can find a Javascipt library that does what you need, your mission > would be easy :) > > Sent from my iPhone > > > On Mar 18, 2017, at 5:03 PM, jonathandly...@gmail.com wrote: > > > > 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 > ___ 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
Re: Colour Manipulation
You could put the entire ImageMagick set of files into custom properties, then, when your app first opens, look to see if ImageMagick is present. If not, then have your app save the ImageMagick files in the same folder as your app. I have done that sort of thing before - big files, but works fine. If you can find a Javascipt library that does what you need, your mission would be easy :) Sent from my iPhone > On Mar 18, 2017, at 5:03 PM, jonathandly...@gmail.com wrote: > > 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 >> 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
Re: Colour Manipulation
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 > 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
Colour Manipulation
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