Last active
May 25, 2021 07:01
-
-
Save wpyoga/a35e9e0416da7ebcffd3dfd509eb2e24 to your computer and use it in GitHub Desktop.
Convert PNG to WebP (Lossless)
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
# -lossless | |
# create a lossless image | |
# you can use '-z 9' to really make a small image, | |
# but my tests show that it only produces around 1% better compression rate, | |
# with much longer compression times | |
# | |
# -resize 1080 1920 | |
# (optional) resize the image | |
cwebp -lossless -resize 1080 1920 image.png -o image.webp | |
# -define webp:lossless=true | |
# create a lossless image | |
# | |
# -resize 1080x1920 | |
# resize the image to 1080x1920 | |
convert image.png -define webp:lossless=true -resize 1080x1920 image.webp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment