Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Ever need to do a distortion on an image (as seen though glass or ice etc) but the distortion matte is too fine - and blurring just makes it too liquid?
I developed this macro so that instead of the above you can blur an image - quantize it to reduce levels, and use this as the basis of the distortion map. It gives sharper - and better defined edges in the distortion than blurring etc will.
Input source as RGBA, A, or use a built in lumakey
use the PreBlur on the image, and set levels, view alpha.
Use postBlur to soften the map if required.
Also has a 'diffBlur' and 4 'diff' outputs - here you use a 2nd or more quantize node(s) and these tools to create a 'fringing' matte so additional distortions, or grades can be applied to other areas.
Of course it can also be used just as a simple levels tool for a colour image which - yes I know, should probably be called posturizing.