Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with a recolor of a folder of images to a set of hex colors.
#7
I finally got this working with the help form here.  Thanks a bunch Rich2005!

In case anyone is interested in the solution here it is.
Code:
echo off
SETLOCAL EnableDelayedExpansion
set "slash=\"
for %%a in (*.png) do ( Rem This reads the directory for .png files that need recolor 1 at a time
    for /f "tokens=*" %%x in (118_hex_colors.txt) do ( Rem this reads in my file of hex colors 1 at a time
         if EXIST "%%~pa%%~na\" ( Rem checks if the folder that the recoloed files need to go into has been created
         echo yes
        )    else (
        mkdir "%%~pa%%~na\" Rem if not it creates it
        )    
             magick %%a -colorspace gray -fill "#%%x" -tint 100 %%~pa%%~na%slash%%%x.png
        Rem the line above does the actual recolors using image magic.
)
)
Reply


Messages In This Thread
RE: Help with a recolor of a folder of images to a set of hex colors. - by Nmbr5 - 12-24-2021, 02:39 AM

Forum Jump: