-- Illustrated
-- Revision 1

--@TBCONFIG SLIDER: Detail Retention, 0
--@TBCONFIG SLIDER: Blending, 99
--@TBCONFIG SLIDER: Contrast, 22
--@TBCONFIG SLIDER: Saturation, 50
--@TBCONFIG SLIDER: EdgeDetail, 40
--@TBCONFIG SLIDER: Outline, 20

--@TBCONFIG FLAG: Enhanced Highlights, true
--@TBCONFIG FLAG: Linear Enhanced, false
--@TBCONFIG FLAG: Anti Alias, true
--@TBCONFIG INFO: Paint Advanced
--@TBCONFIG INFO: Revision 2
--@TBCONFIG INFO: This filter does not honor any existing masks and will disable the mask.
--@TBCONFIG INFO:  

paint_open(0)

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

-- Create Line Art
paint_buffer_from_layer(0)
paint_filter("Negative",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
paint_filter("Glow",0,sliderVal6 * 1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
paint_filter("Negative",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
paint_filter("Line Art Cleaner",0,980,1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
if flagVal3 == true then
  paint_filter("Anti Alias",0,500,500,1000,1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
end 
paint_buffer_from_layer(1)

paint_buffer_to_layer(0)
paint_filter("Detail Blur",0,sliderVal1 * 1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
paint_filter("Surface Blur",0,900,sliderVal2 * 1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
paint_filter("Contrast Mask",0,1000,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)

paint_filter("Surface Blur",0,500,600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)

if flagVal2 == false then
  paint_filter("Photo Detailer",0,1000,sliderVal3 * 1000,350 + sliderVal4 * 200,sliderVal5 * 750,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
else  
  paint_filter("Photo Detailer",0,600,sliderVal3 * 1000,400 + sliderVal4 * 200,sliderVal5 * 750,0,0,3,0,0,0,0,0,0,0,0,0,0,0)
end

paint_filter("Surface Blur",0,700,600,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)

if flagVal1 == true then
  paint_buffer_from_layer(0)

  paint_filter("Hyper Contrast",0,500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
  paint_mask_create_from_image_luma()
  paint_mask_invert()
  paint_mask_on(0)
  paint_buffer_to_layer(0)

  paint_mask_on(1)
  paint_filter("Hyper Contrast",0,500,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
  paint_mask_clear()
end 

paint_buffer_merge_layer(1, MERGE_MULTIPLY, 255)

-- 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()




