I want to replace my .png and .jpg files in android project with .webp to reduce the app size.
I am verifying these 3 cases for jpg to webp conversion(for both .png and .jpg) :
for Case 1, size was reduced by ~30% as expected
But for cases 1 and 2, size was increased significantly(170KB of .jpg to 470KB of .webp) instead of decreasing.
Command used :
cwebp -q 100 input.jpg -o output.webp
This is working fine with .png images for all three cases where sizes are reduced when converted to .webp format.
But the same is not working with the .jpg image ? Does size reduction depend on .jpg image ? Is size guaranteed to reduce when converted from .jpg/.png to .webp ? Why did the size increase ?
Version of libwebp : libwebp-0.4.3 OS - Windows 64-bit
Using WebP, webmasters and web developers can create smaller, richer images that make the web faster. WebP lossless images are 26% smaller in size compared to PNGs. WebP lossy images are 25-34% smaller than comparable JPEG images at equivalent SSIM quality index.
Google's research shows it has managed to successfully compress images into significantly smaller file sizes. The company reports that WebP boasts the benefit of being 26% smaller than PNG files and 23–24% smaller than equivalent JPG files. A WebP image size can be up to 16383 × 16383 pixels.
The WebP compression algorithm was created, according to Google, as an alternative for both PNG and JPEG files. Generally, the resulting WebP image is on average 26% smaller than the original PNG, and 25-34% smaller than the original JPEG.
❓ How can I resize a WEBP image? First, you need to add a WEBP image file: drag & drop your WEBP image file or click inside the white area to choose a file. Then adjust resize settings, and click the "Resize" button. After the process completes, you can download your result file.
The problem you face is that with JPEG there is are large number of variables you can manipulate to get different compression. That is the benefit you get from lossy compression. Lossless compression tends to have few (if any options). In lossless compression, the tradeoff is time vs. compression. In lossy it is quality vs. compression.
You are running a lossy compressed image through a second lossy compression process and getting rather unpredictable results.
The real comparison would be to take your PNG images and compress them using webp and JPEG using various settings to see what quality you get compared to the compression.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With