Last active
April 10, 2019 06:26
-
-
Save lineharo/44e1dbba71c7e39ae11f9763c79e11ae to your computer and use it in GitHub Desktop.
Обрезка и оптимизация изображений (jpeg) - batch for Windows with ImageMagick & JpegTran
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
rem Преобразовывает все изображения в 1024*768 и 285х200 + оптимизирует их | |
rem Нужны программы: ImageMagick (https://www.imagemagick.org/script/download.php) и jpegtran (http://jpegclub.org/jpegtran/) | |
for %%f in (*.jpg) do ( | |
magick %%f -resize "285x200^" -gravity center -extent 285x200 "%%~nf-thumb.jpg" | |
jpegtran -copy none -optimize -progressive -outfile "%%~nf-thumb.jpg" "%%~nf-thumb.jpg" | |
magick %%f -resize "1024x768<" -gravity center -extent 1024x768 "%%~nf-view.jpg" | |
jpegtran -copy none -optimize -outfile "%%~nf-view.jpg" "%%~nf-view.jpg" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment