From 9fec5e39b4cfc74b718d7467330e13a82d67d97b Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Mon, 13 Jul 2026 13:51:39 -0600 Subject: [PATCH] fuckin ffmpreg_gif_loopy.ps1 now proper --- Windows-Scripts/ffmpreg_apng_loopy.ps1 | 7 ------- Windows-Scripts/ffmpreg_gif_loopy.ps1 | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 7 deletions(-) delete mode 100644 Windows-Scripts/ffmpreg_apng_loopy.ps1 create mode 100644 Windows-Scripts/ffmpreg_gif_loopy.ps1 diff --git a/Windows-Scripts/ffmpreg_apng_loopy.ps1 b/Windows-Scripts/ffmpreg_apng_loopy.ps1 deleted file mode 100644 index 8212999..0000000 --- a/Windows-Scripts/ffmpreg_apng_loopy.ps1 +++ /dev/null @@ -1,7 +0,0 @@ -param( - # powershell is factually gay idkl why its such a shit - [Parameter(Mandatory=$True, Position=0)] - [string]$Filename -) -# apng is far hjigher quality and also preserves transparancy :activated: -ffmpeg -i "$Filename" -plays 0 -f apng "$Filename.apng" \ No newline at end of file diff --git a/Windows-Scripts/ffmpreg_gif_loopy.ps1 b/Windows-Scripts/ffmpreg_gif_loopy.ps1 new file mode 100644 index 0000000..05fb1b4 --- /dev/null +++ b/Windows-Scripts/ffmpreg_gif_loopy.ps1 @@ -0,0 +1,18 @@ +param( + # powershell is factually gay idkl why its such a shit + [Parameter(Mandatory=$True, Position=0)] # deband the param, its in position 0 so ya canb just ffmpreg_gif_loopy filename.mp4 OR ffmpreg_gif_loopy -Filename filename.mp4 + [string]$Filename # var for filename string +) +# apng is far hjigher quality and also preserves transparancy :activated: +$noextpath = [System.IO.Path]::GetFileNameWithoutExtension($Filename) # get filename without extension +$gifpath = "$noextpath`_MAXLOOP.gif" # add da .gif extension and MAXLOOP tag + +# ffmpeg +## -i input file (mp4) +## settings for -filter_complex purely vibe coded for max quality +### split [a][b]: Splitting clones the video stream into two identical, simultaneous feeds. This lets you process the color palette and render the GIF all in one +### palettegen=stats_mode=single: This generates the highest quality 256-color palette based strictly on the exact colors present in your video. Changing the mode to single tells FFmpeg to optimize colors for moving objects across frames. +### paletteuse=dither=bayer:bayer_scale=5: This dictates how colors are blended. Using a strict bayer dither with a scale of 5 keeps gradients incredibly clean and crisp, eliminating the ugly "cross-hatch" or "grainy" patterns typical of basic GIFs +## -loop 0 maek da gif loop +## outputfile (gif) +ffmpeg -i "$Filename" -filter_complex "[0:v] split [a][b];[a] palettegen=stats_mode=single [p];[b][p] paletteuse=dither=bayer:bayer_scale=5" -loop 0 "$gifpath" \ No newline at end of file