How to Optimize JPEG & PNG Images Using jpegtran & OptiPNG in Windows

You may also like...


  1. jul059 says:

    You can easily shave off a few additionnal bytes fast by using DeflOpt.exe after the png optimization.

  2. Justin Laney says:

    That PNG compressor doesn't do a very good job. I took an almost 7MB PNG file from a raw blender render, and tried to level 7 compress it. It only got 13% off. Any respectable tool should be able to knock off at least 70%. A really good tool can get over 80% off.

    • The Web Flash says:

      OptiPNG uses lossless optimization to reduce images file size to a minimum, without losing any information. It might not provide significant file size savings compared to other optimizers that use lossy optimization or a combination of both.

  3. Andrew says:

    It says access denied... What to do?

  4. Maxime says:

    how can i change the outfile directory with this batch, because if i do something like :

    forfiles /s /m *.jpg /c "cmd /c @\"C:\Program Files\Image Optimization\jpegtran.exe\" -copy none -optimize -progressive -outfile C:\path\to\my\output\directory\@file @file"

    This is not working ...

    Thanks for your help !

    • The Web Flash says:

      Try surrounding the output file path with double quotes like so:

      forfiles /s /m *.jpg /c "cmd /c @\"C:\Program Files\Image Optimization\jpegtran.exe\" -copy none -optimize -progressive -outfile \"C:\path\to\my\output\directory\\@file\" @file"
  5. shrinivas says:


    I get the following error -

    ERROR: Invalid argument/option - '*.jpeg'

    any idea what am I doing wrong?


  6. Paul McCollam says:

    Thanks for the tutorial!

    However, I'm getting an error:
    "'forfiles' is not recognized as an internal or external command, operable program or batch file."

    Any ideas?

    Windows 7 64 bit

Leave a Comment

Wrap your code block in [code] and [/code] tags.

This site uses Akismet to reduce spam. Learn how your comment data is processed.