Page 1 of 2

Image Processing with Flowstone?

PostPosted: Fri Mar 12, 2021 4:17 pm
by martinvicanek
Inspired by the recent Drop Shadow thread, I was wondering to what extent it was possible to do image processing with Flowstone. As promising as the possibilities of Ruby may be, unfortunately there is little available in the implementation at pixel level, and more unfortunately, excecution time is often prohibitive to allow even basic image transformations.

Flowstone has the assembler codebox as a fast number crunching engine, but it is a bit awqward to interface with an image format. Moreover, there are no 2D arrays in ASM and everything is very low level, which makes the addressable audience for this type of excercise rather small.

Anyway, here is an example of a drop shadow effect for an input image with an alpha channel for opacity. It uses a fast blur algorithm by Young et al., if you care.
capture.png
capture.png (33.98 KiB) Viewed 16601 times

ImageProcessing.fsm
(40.76 KiB) Downloaded 910 times

It would be cool to drag the shadow with the mouse instead of setting x- and y-offsets with knobs. Any volunteers?

Re: Image Processing with Flowstone?

PostPosted: Fri Mar 12, 2021 6:07 pm
by martinvicanek
A slight variation makes it possible to drop a shadow on a background image.
capture.png
capture.png (68.77 KiB) Viewed 16594 times

DropShadowOnBackgroundImage.fsm
(62.85 KiB) Downloaded 912 times

Re: Image Processing with Flowstone?

PostPosted: Sat Mar 13, 2021 12:48 am
by adamszabo
Wow, now that is what you call "dope" :shock: :D

Re: Image Processing with Flowstone?

PostPosted: Sat Mar 13, 2021 2:02 am
by tulamide
It is somehow sad, that Martin has to use his ASM prowess just to realise what every graphic chip, incl. in-built chips, do so much faster, and with just one command. All the shaders that sit in my PC unused while ASM now needs to be used for both audio and graphics.

Sigh.

Re: Image Processing with Flowstone?

PostPosted: Sat Mar 13, 2021 2:29 am
by RJHollins
... then you look inside at the Code, and realize how much knowledge goes into this.

Nice MV 8-)

Re: Image Processing with Flowstone?

PostPosted: Sat Mar 13, 2021 8:22 am
by Spogg
Amazing work Martin! :o :shock:

I agree with tulamide that it’s such a shame we can’t access any modern graphics power. That crank handle on my Hurdy Gurdy used loads of CPU power and triggers. I got it as good as I could but once again it made me realise what could be done if only…

Re: Image Processing with Flowstone?

PostPosted: Sat Mar 13, 2021 5:22 pm
by deraudrl
Spogg wrote:I agree with tulamide that it’s such a shame we can’t access any modern graphics power.
Might not hurt to pass this along on the FS4 Slack forum "wish list". At the very least, with better access/insight into underlying memory structures etc, external graphics libraries/hardware would be in play via the DLL component.

Re: Image Processing with Flowstone?

PostPosted: Sun Mar 14, 2021 5:02 am
by tulamide
deraudrl wrote:
Spogg wrote:I agree with tulamide that it’s such a shame we can’t access any modern graphics power.
Might not hurt to pass this along on the FS4 Slack forum "wish list". At the very least, with better access/insight into underlying memory structures etc, external graphics libraries/hardware would be in play via the DLL component.

Unfortunately, this was brought up several times. MyCo made his standpoint clear. He thinks, GDI+ is more than enough to do everything you want, graphics-wise.

Of course, that's not true. But that is also a problem for me. If he just would say, "OpenGL is over my head", or something along the lines, I could at least give up hope. But the way he said it, always let's me hope, that he's just stubborn, and would actually use OpenGL (or better yet, OpenCL, google it to see, why I think it would be the best for Flowstone), if only enough people ask for it. But, this goes on for 4 years now, wthout any sign, that MyCo could be convinced of the benefits.

Re: Image Processing with Flowstone?

PostPosted: Sun Mar 14, 2021 7:58 am
by Spogg
I was surprised when Maik made his opinion clear on OpenGL. Surely he must have seen some pro plugins and even free ones that have lovely and useful animations. When I see that sort of thing I always feel a bit sad that I could never make such things. I’m not saying I could compete even if we had OpenGL, but it would be nice to have an opportunity to at least have a go.

I guess on one level he has some sort of point, namely that animations don’t affect the sounds made by synths and FX. But, like in the case of my Hurdy Gurdy crank handle, I think animations do help with engagement and appeal.

But I’m preaching to the choir! :lol:

Re: Image Processing with Flowstone?

PostPosted: Sun Mar 14, 2021 9:43 pm
by HughBanton
But I think what Maik actually said was that, because of Flowstone's modular sandbox format, adding OpenGL the cpu usage could go up by a factor of 1000. Even if he's exaggerating just a bit (which he probably wasn't) that would clearly put OpenGL and the like completely out of bounds for FS. Flowstone and Juce are not the same thing.

As Maik said, "it's just completely inpractical for a Software that allows the user to do whatever they want". Too true - the UK government nearly came seriously unstuck over Covid last year because of MS Excel ..

Mind you, they then went on to [deleted .. HB] :roll:

H

PS Really nice work Martin!