Skip to content

Instantly share code, notes, and snippets.

@FabulousCupcake
Created November 26, 2024 11:51
Show Gist options
  • Save FabulousCupcake/77f91fa6d5102b85891117067bb42a21 to your computer and use it in GitHub Desktop.
Save FabulousCupcake/77f91fa6d5102b85891117067bb42a21 to your computer and use it in GitHub Desktop.
How to tell if a `.webp` image is Lossless or Lossy

How to tell if a .webp image is Lossless or Lossy

Surprisingly doable with the ubiquitous file command:

$ file lossy.webp
lossy.webp: RIFF (little-endian) data, Web/P image, VP8 encoding, 1536x2560, Scaling: [none]x[none], YUV color, decoders should clamp

$ file lossless.webp
lossless.webp: RIFF (little-endian) data, Web/P image

The presence of VP8/VP9 data stream indicates that it is lossy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment