-
-
Save Rplus/6279394 to your computer and use it in GitHub Desktop.
image minify in windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gif > png8 | |
@echo off | |
set CONVERT=D:\Software\PIC\ImageMagick-6.8.3-6\convert.exe | |
for %%a in (%*) do ( | |
dir /a %%a|findstr "DIR" >nul 2>nul && ( | |
"%CONVERT%" %%a "%%~dpna.png\*" | |
) || ( | |
"%CONVERT%" %%a "%%~dpna.png" | |
) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# jpg > tran > progressive jpeg | |
@echo off | |
set JPEGtran=D:\Software\PIC\jpegtran\jpegtran.exe | |
for %%a in (%*) do ( | |
dir /a %%a|findstr "DIR" >nul 2>nul && ( | |
"%JPEGtran%" -copy none -optimize -perfect %%a "%%~dpna_tran%%~xa" | |
rename "%%~na%%~xa" "%%~na_0%%~xa" | |
"%JPEGtran%" -copy none -optimize -perfect -progressive "%%~dpna_tran%%~xa" "%%~dpna_tran_p%%~xa\*" | |
) || ( | |
"%JPEGtran%" -copy none -optimize -perfect %%a "%%~dpna_tran%%~xa" | |
rename "%%~na%%~xa" "%%~na_0%%~xa" | |
"%JPEGtran%" -copy none -optimize -perfect -progressive "%%~dpna_tran%%~xa" %%~dpna_tran_p%%~xa | |
) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# png > 8bit > crush | |
set PNGquant=D:\Software\PIC\PNGquant\pngquant.exe | |
set PNGcrush=D:\Software\PIC\pngcrush\pngcrush.exe | |
for %%a in (%*) do ( | |
dir /a %%a|findstr "DIR" >nul 2>nul && ( | |
"%PNGquant%" -ext _8bit.png -iebug -force -verbose 256 %%a | |
rename "%%~na%%~xa" "%%~na_0%%~xa" | |
"%PNGcrush%" -rem alla -brute -reduce "%%~dpna_8bit%%~xa" "%%~dpna%%~xa\*" | |
) || ( | |
"%PNGquant%" -ext _8bit.png -iebug -force -verbose 256 %%a | |
rename "%%~na%%~xa" "%%~na_0%%~xa" | |
"%PNGcrush%" -rem alla -brute -reduce "%%~dpna_8bit%%~xa" %%~dpna%%~xa | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment