I stand with the people of Ukraine during this heinous assault on their freedoms, their independence, and their very lives.

2021-04-02

PNGQuant CLI

 02 Apr 2021  Snippets

PNGQuant CLI

Intallation
sudo apt install pngquant -y
Shell Aliases

Command usage with sensible defaults:

png() { pngquant "[email protected]" --quality 90-100 --speed 1 --skip-if-larger --strip --ext -quant.png }

Above command does the following:

  • Uses a quality scale with minimum of 90% and maximum of 100% for best results
  • Prioritizes quality over speed, which makes no difference on modern hardware
  • Skips the operation if the output file will be larger than the input file
  • Strips all metadata from the file
  • Adds a -quant.png suffix to the file

Example syntax (and output with a filesize reduction of ~64%):

png Screenshot-from-2021-04-02-09-55-45.png

# (exit code 0)

ls

-rw-rw-r-- 1 paramdeo paramdeo  91K Apr  2 09:55 'Screenshot from 2021-04-02 09-55-45.png'
-rw-rw-r-- 1 paramdeo paramdeo  33K Apr  2 10:07 'Screenshot from 2021-04-02 09-55-45-quant.png'
Webmentions & Comments

ETH Deposit Address

BTC Deposit Address

Copyright © Paramdeo Singh. Made with ☕️ in Guyana. All Rights Reserved.

Last Site Build on 18 Mar 2022

1MB Club Badge

Paramdeo Singh Guyana

Riding the wave of consciousness in this treacherous mortal sea.

Technology Design Strategy Literature Personal Blogs