Goal: convert an icon (single-colour, black, with transparent background) from either an svg or xcf, to a png and change the colour of the icon (e.g. black becomes white or a specified hex colour).
ImageMagick version: 7.0.11-6
Progress so far: I have a Windows batch file that
col-*.*
in the folder
col-*.*
file and save the pngI have had some success, but have found that
Is there a better way to re-colour these pngs? Or a way to stop the fuzziness? I have just started working with ImageMagick. Many thanks!
Current batch file
@echo off
set resolution=72
set width=48
setlocal enableDelayedExpansion
for %%i in (*.xcf) do (
echo Converting [ %%i --^> %%~ni.png ] ^(%width%@%resolution%^)
for %%x in (os-col-*.*) do (
magick %%i -resize %width% -resample %resolution% -remap %%x %%~ni-%width%-%%x.png
echo Done %%i - %%x
)
echo Done %%i
)
black png, no fuzziness
fuzziness in a png with -remap applied
Using ImageMagick, if your input is a single color and you want to change it to another while retaining the transparency, this command should do exactly that...
convert input.png -fill #75965b -colorize 100 result.png
That creates this output image....
That is in IMv6 syntax. For IMv7 use "magick" instead of "convert".