@set /p CLUT=How Many Colors (4..256): @echo Number of colors: %CLUT% @set /p BS=Bayer_Strength (0..5 lower is stronger): @echo Bayer Strength: %BS% @ffmpeg.exe -y -stats -hide_banner -i "%1" -an -sn -dn -sws_dither ed -filter_complex "crop=1920:784:0:148,scale=640:-2:sws_flags=spline+accurate_rnd+full_chroma_int+full_chroma_inp:in_range='mpeg/tv':out_range='jpeg/full/pc',hqdn3d=5,smartblur=lr=1.75:ls=-0.50:lt=-5.5:cr=0.5:cs=1.0:ct=0.5,minterpolate=fps=25/2:mi_mode=mci:me_mode=bidir:me=epzs:vsbmc=1,scale=320:-2:sws_flags=spline+accurate_rnd+full_chroma_int+full_chroma_inp,xbr=2,scale=iw/2:-2:sws_flags=spline+accurate_rnd+full_chroma_int+full_chroma_inp,format=pix_fmts=rgb444le,split=2[vid][clut];[clut]palettegen=max_colors=%CLUT%:reserve_transparent=0:stats_mode=diff[out2]" -map [vid] -c:v ffv1 "%~n1_ll.mkv" -map [out2] "%~n1_CLUT%CLUT%_D.png" @ffmpeg.exe -y -stats -hide_banner -i "%~n1_ll.mkv" -i "%~n1_CLUT%CLUT%_D.png" -lavfi "paletteuse=dither=bayer:bayer_scale=%BS%" -loop 0 -vsync 0 "%~n1_CLUT%CLUT%_D_BS%BS%.gif" @rem Optimizing GIF... @gifsicle.exe -V -O3 "%~n1_CLUT%CLUT%_D_BS%BS%.gif" -o "%~n1_CLUT%CLUT%_D_BS%BS%_o.gif"