Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save eladkarako/f07aaf25dd11ab8bea07ea622b034993 to your computer and use it in GitHub Desktop.

Select an option

Save eladkarako/f07aaf25dd11ab8bea07ea622b034993 to your computer and use it in GitHub Desktop.
convert png to icon that is compatible with windows, auto size (you can add more)
@echo off
chcp 65001 1>nul 2>nul
pushd "%~dp0"
set "PATH=%CD%;%PATH%"
"magick.exe" "%~1" -filter Lanczos -define "icon:auto-resize=256,128,64,48,32,16" -unsharp "0x1+0.75+0.02" "%~sdp1%~n1_converted.ico"
pause
popd
exit /b 0
::https://imagemagick.org/download/#windows&gsc.tab=0
::you can drag-and-drop pictures of any sizes and it will resize it while trying to keep the sharpness and quality.
::you'll get an image in the same folder of the input image, same name, with addition of _converted and extension .ico.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment