Skip to content

Instantly share code, notes, and snippets.

@w33zy
Forked from VirtuBox/jpg-png-optimize.md
Created January 4, 2018 20:39
Show Gist options
  • Save w33zy/7b948d10175f5417af60ce0128e1e1bd to your computer and use it in GitHub Desktop.
Save w33zy/7b948d10175f5417af60ce0128e1e1bd to your computer and use it in GitHub Desktop.

Revisions

  1. @VirtuBox VirtuBox revised this gist Dec 24, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion jpg-png-optimize.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # JPG and PNG image bulk optimization with jpegoptim and optipng
    # JPG and PNG image bulk optimization

    ### Install jpegoptim and optipng
    ```
  2. @VirtuBox VirtuBox created this gist Dec 24, 2017.
    17 changes: 17 additions & 0 deletions jpg-png-optimize.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    # JPG and PNG image bulk optimization with jpegoptim and optipng

    ### Install jpegoptim and optipng
    ```
    apt update && apt install jpegoptim optipng -y
    ```

    ### JPG optimization
    ```
    cd /path/to/your/image/folder
    find . -iname "*.jp*" -print0 | xargs -0 jpegoptim --strip-all -m76
    ```
    ### PNG optimization
    ```
    cd /path/to/your/image/folder
    find . -iname '*.png' -print0 | xargs -0 optipng -o7 -preserve
    ```