How to extract organized palette from image/video with FFMPEG+Imagemagick?
<p>I use FFMPEG and Imagemagick to extract the color palette from an image or video with a Windows batch file,</p>

<pre><code>:: get current folder name
for %%* in (.) do set CurrDirName=%%~nx*

:: get current filename
for /R %1 %%f in (.) do (
    set CurrFileName=%%~nf
)

ffmpeg -i "%1" -vf palettegen "_%CurrFileName%_temp_palette.png"
convert "_%CurrFileName%_temp_palette.png" -filter point -resize 4200%% "_%CurrFileName%_palette.png"

del "_%CurrFileName%_temp_palette.png"
</code></pre>

<p>This outputs something like,</p>

<p><a href="https://i.stack.imgur.com/16MnQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/16MnQ.png" alt="Palette"></a></p>

<p>I need this to have better transition throughout the color blocks though, like all blues from darkest to lightest then transitioning to greens, yellows etc. like,</p>

<p><a href="https://stanford.edu/~mwaskom/software/seaborn/_images/color_palettes_27_0.png" rel="nofollow noreferrer"><img src="https://stanford.edu/~mwaskom/software/seaborn/_images/color_palettes_27_0.png" alt="Better Palette"></a></p>

<p>Is there a way/switch to create this with either Imagemagick/FFMPEG?</p>