--@TBCONFIG INFO: Skin Enhance
--@TBCONFIG INFO: Revision 3
--@TBCONFIG INFO: This filter does not honor any existing masks and will disable the mask.
--@TBCONFIG INFO:  
--@TBCONFIG SLIDER: Hus (Change with caution), 7
--@TBCONFIG SLIDER: Hue Threshold, 20
--@TBCONFIG SLIDER: Luminance (Change with caution), 65
--@TBCONFIG SLIDER: Luminance Threshold, 19
--@TBCONFIG SLIDER: Smoothing Strength, 50
--@TBCONFIG SLIDER: Smoothing Threshold, 50


paint_open(0)

-- Standard mask preservation
-- paint_buffer_from_layer(30)
paint_buffer_from_mask(31)

paint_buffer_from_layer(0)

paint_filter("Mask Generate HSL",0,sliderVal1 * 1000,sliderVal2 * 1000,1000,1000,sliderVal3 * 1000,sliderVal4 * 1000,0,0,1,0,0,0,0,0,0,0,0,0)
paint_mask_on(0)
paint_create_from_mask()
paint_filter("Gaussian Blur",0,500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
paint_mask_create_from_image()
paint_mask_on(0)

paint_buffer_to_layer(0)

paint_mask_invert()
paint_mask_on(1)

paint_filter("Surface Blur",0,sliderVal5 * 1000,sliderVal6 * 1000,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0)

paint_mask_on(0)
paint_mask_clear()

-- Standard mask preservation
paint_buffer_to_mask(31)
-- paint_mask_invert()
-- paint_mask_on(1)
-- paint_buffer_to_layer(30)
-- paint_mask_invert()

paint_close()




