Tag Archives: Image Optimization

JPG/PNG Image Optimization

keep-calm-and-start-optimizing[1]In a previous post I refer to image optimization. I started working with image optimization when i got reports from the google webmaster tools that the images used in my web sites are not optimized.

Searching in the internet I ended up working with jpegtran and optipng for the optimization of the images I use in the web. I use the following two batches to automate somehow the whole process. I place the image inside the “Optimize” folder and then according to the file type run the appropriate batch script.

cd "E:\Dropbox\wamp\www\Optimise"
E:
FOR %%G IN (*.jpg) DO (
copy %%G log\%%G
"E:\Dropbox\wamp\www\Optimise\JPGPNGOPT\jpegtran\jpegtran.exe" -optimize %%G %%G
MOVE %%G OPTED\%%G
)
 FOR %%G IN (*.png) DO (
copy %%G log\%%G
"E:\Dropbox\wamp\www\Optimise\JPGPNGOPT\pngout.exe" "E:\Dropbox\wamp\www\Optimise\%%G" "E:\Dropbox\wamp\www\Optimise\%%G" /y
MOVE %%G OPTED\%%G
)