Core Image filter replacement

I really need a few of the CI filters as they are bloody useful for a lot of tasks (edge detection, sharpening…), but as Vuo (luckily I might add) don’t use CI, I guess they have to be rewritten for Vuo. How would I go about doing so, is there a source code for the filters somewhere, or is it an Apple secret?

Just adding a few proof of concepts for doing it in Vuo, but they get unnecessarily convoluted, huge and resource intensive compared to what I believe are their more purely coded counterparts in CI. The Bloom effect is fairly simple, just a bunch of reduced resolutions and blur, but the (attempt at) edge detection is a lot worse both in execution and resources. I barely understood the idea of what I was doing when building it.

The edge detection is a cool effect in itself though, if you wish to play with it, the parameters of the Adjust Source/Processed Image Colors and the Mask Image by Brightness nodes are (mainly) the ones to play around with.

BloomTest.vuo (16.8 KB)

EdgeDetectionTest2.vuo (11.8 KB)

Vuo would do this in GLSL. I found an edge detection that was correct license for Vuo. Either team vuo can use that code (which I emailed through) or I can paste it here. Check out shader toy for other effects. Remember that many shaders are not licensed correctly for inclusion into vuo- which needs a MIT style license.

1 Like

Cool Martinus !

Vuo would do this in GLSL

Really hope the upcoming GLSL node will allow us to use all those custom shaders to be found on the web, at least for personnal use, and that it will be fairly easy enough for people like me with no coding experience to use :s

I was thinking more along the lines on how to implement it in custom nodes in Qt. Doesn’t Vuo already use OpenGL (or is it OpenCL?) there? Took a peak at the blur node, but it just references another function. A peak at the code would be nice if you have the chance to post it.

I really hope the GLSL node won’t be a replacement for stock filters though.

Its my understanding that nodes that do lots of video effects are GLSL nodes inside. (If you check out the vuo.image.bulge.c you will see that inside its simply GLSL)

Currently Vuo doesn’t use OpenCL (although it would be nice!).

There are ways to manipulate video data on the CPU, but you probably only want to do that if you can’t achieve the same thing on the GPU, (like crazy Machine Vision stuff etc).

I think @Bodysoulspirit that the updated shadertoy node will be best for you to ‘cut and copy’ from the web, especially from Shadertoy webpage. Team Vuo have actually posted that as a bug report themselves, so maybe in the mythical 1.2.2 update we will get it? I don’t know. I am however starting to get update withdrawal symptoms… not good. :-(

2 Likes

Aha, ok, if it isn’t worse then it should be fairly straightforward to implement a few more image filters in that section. I’ll probably look into it some day. Thanks for the heads up.

I don’t have a too good of an understanding of the whole CL vs GL thing, I just read somewhere that there is a shift in the cross platform thing from one to the other.

@Bodysoulspirit the conversion from shadertoy isn’t really too difficult as is, although it is a bit fiddly. The main parts are the main:

void mainImage(a lot of stuff)

that should be replaced with:

void main(void)

the other parts you usually have to change are:

fragCoord -> gl_FragCoord

fragColor -> gl_FragColor

I’ve also found that you should remove any comments in the code, and if there is anything wrong with it, it is reported in the OS X console under Vuo something something GLSL

1 Like

I also guess this will come in handy: http://www.ozone3d.net/tutorials/image_filtering.php

1 Like

Thanks for the tips guys ! Appreciate !

If you want to make shadertoy work in Vuo 1.2.1 (before team Vuo fix the node to work with the new shadertoy format) then I wrote some info here:

https://community.vuo.org/t/-/5397

Hopefully when Vuo 1.3 is released it will have the updated shadertoy node which will allow copy and paste from the shadertoy webpage! Yay! (Until shadertoy change their syntax again…)

2 Likes

is there a source code for the filters somewhere, or is it an Apple secret?

Apple’s Core Image filters are proprietary / no source available. But GPUImage/framework/Source at master · BradLarson/GPUImage · GitHub has a lot of BSD-licensed GLSL image filter code.

2 Likes