# Image Compressor > Shrink JPG, PNG, WebP, AVIF or GIF images: convert, resize, strip metadata and compare sizes. Re-encodes an image as WebP, AVIF, JPEG or PNG at the quality you choose, optionally scales it down to a maximum width or height and removes metadata such as GPS location. Shows the before/after size, the saving and the new dimensions, with a preview and a download. Part of usefulweb.site (https://usefulweb.site/). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://imagecompressor.usefulweb.site/ (interactive tool at https://imagecompressor.usefulweb.site/tool) - JSON API: POST https://imagecompressor.usefulweb.site/api/v1/calculate with a JSON object of inputs (schema: https://imagecompressor.usefulweb.site/api/v1/tool) - OpenAPI: https://imagecompressor.usefulweb.site/openapi.json - MCP (Streamable HTTP): https://imagecompressor.usefulweb.site/mcp - tool `image_compressor` ## Inputs - file (file, required): Image - JPG, PNG, WebP, AVIF or GIF (first frame), max 30 MB. Processed on our server and deleted; the result can be downloaded for about 2 hours. - format (select): Output format - quality (integer): Quality - 1 = smallest file, 100 = best quality. Ignored for PNG, which is always lossless. - maxWidth (integer): Maximum width - Optional. Larger images are scaled down proportionally; smaller ones are never enlarged. - maxHeight (integer): Maximum height - Optional. Applied together with the maximum width. - stripMetadata (boolean): Remove metadata (EXIF, GPS location, camera details, colour profile comments) ## Method - The file type is detected from its first bytes, not from the file name; only JPEG, PNG, WebP, AVIF and GIF are accepted. For animated GIFs only the first frame is used. - ImageMagick decodes the image, applies the EXIF orientation, optionally scales it down (never up) to fit the maximum width/height, and encodes it in the chosen format. AVIF is encoded with libavif (avifenc) when it is installed. - Quality is passed to the encoder as is (1–100). PNG output is lossless, so quality does not apply; PNG is usually larger than WebP/AVIF for photos. - With "Remove metadata" on, EXIF/XMP/IPTC data (including GPS location and camera details), comments and embedded profiles are removed. Timestamps are never written, so the same input always gives the same file. - Files are processed in a private temporary folder that is deleted right after processing. The result is kept for about 2 hours so you can download it, then deleted. ## Limits - Lossy formats (WebP, AVIF, JPEG) discard detail; keep your original.