@echo off color 0f Title convert_syslinux_rev3a.bat REM updated 10.24.2014 REM Place this batch file anywhere and drag and drop the image files REM (bmp, jpg or png) to be converted on it (other image formats may not REM convert correctly). Converted files will be moved to the same directory REM as this file. REM Drag and drop single or multiple 640x480 (or with the same aspect ratio) REM images into this batch file to convert them to Syslinux compatible splash REM images with ImageMagick. The converted file(s) will have the size and REM number of colors used appended after the name, and the extension(s) changed REM as selected. This script works for files only (it will not work for folders). REM Tested on Vista and WinXP with ImageMagick portable installed to REM F:\Utilities folder. REM CD "%~dp0" changes the working directory to the current directory REM (where this batch file is located) REM "%~n1" is the filename minus the extension CD "%~dp0" set cdir=%~dp0% echo. echo Current directory is: "%~dp0" echo. echo Output format: echo 1. JPG echo 2. PNG SET INPUT= SET /P INPUT=Select image format: IF /I "%INPUT%"=="1" set pformat=jpg IF /I "%INPUT%"=="2" set pformat=png echo. echo Number of colors: echo 1. 14 echo 2. 24 echo 3. 256 echo 4. 2560 (slow, doesn't change orginal num of colors) echo 5. 0 - keeps original num of colors. If error occurs, use another option SET INPUT= SET /P INPUT=Select number of colors: IF /I "%INPUT%"=="1" set ncolor=14 IF /I "%INPUT%"=="2" set ncolor=24 IF /I "%INPUT%"=="3" set ncolor=256 IF /I "%INPUT%"=="4" set ncolor=2560 IF /I "%INPUT%"=="5" set ncolor=0 echo. echo Select size - converts to 4:3 aspect ratio for GRUB/Grub4Dos echo 1. Resize to 640x480, %ncolor% colors echo 2. Resize to 800x600, %ncolor% colors echo 3. Resize to 1024x768, %ncolor% colors echo 4. Resize to 1280x960, %ncolor% colors echo 5. Resize to 1400x1050, %ncolor% colors echo 6. Resize to 1600x1200, %ncolor% colors echo 7. Resize to 2048x1536, %ncolor% colors echo 8. Exit SET INPUT= SET /P INPUT=Select a number to start conversion: IF /I "%INPUT%"=="1" set rsize=640x480 IF /I "%INPUT%"=="2" set rsize=800x600 IF /I "%INPUT%"=="3" set rsize=1024x768 IF /I "%INPUT%"=="4" set rsize=1280x960 IF /I "%INPUT%"=="5" set rsize=1400x1050 IF /I "%INPUT%"=="6" set rsize=1600x1200 IF /I "%INPUT%"=="7" set rsize=2048x1536 IF /I "%INPUT%"=="8" goto end echo. echo converting to %rsize%, %ncolor% colors echo. REM initialize count set count=0 :Loop IF [%1]==[] goto continue F:\Utilities\ImageMagick\convert -resize %rsize% -colors %ncolor% -depth 16 ^ %1 "%~n1_%rsize%_%ncolor%.%pformat%" move "%~n1_%rsize%_%ncolor%.%pformat%" "%cdir%" echo "%~nx1 converted to %~n1_%rsize%_%ncolor%.%pformat%" echo "converted image moved to:" echo "%cdir%" echo. set /A count+=1 SHIFT goto Loop :continue echo. echo %count% conversions completed.... echo. REM line below opens output folder; optional and may be deleted or commented out REM %SystemRoot%\explorer.exe "%cdir%" @pause REM --------------------------- exit ----------------------------------------- :end EXIT /B 0