Resize an image without losing the part that matters
A store may need a square picture while your original is wide. Choosing the output dimensions is only half the decision: you also need to decide which parts of the picture can be left out.
Shape comes before pixel count
Aspect ratio describes the relationship between width and height, not the file size. Keeping that ratio preserves the shape of faces and circles; changing the two dimensions independently can stretch them.
If you only need a smaller version of the same picture, preserve its ratio. When the destination requires a fixed shape, choose deliberately between a complete picture with margins and a cropped picture that fills the space.
References: MDN — Aspect-preserving contain and cover, and stretched fill
Cropping makes an editorial decision
Contain keeps the whole image and may leave margins. Cover preserves its proportions while cropping excess content. Stretch fills the dimensions without cropping, but can distort the picture.
ToolRoof uses a centered crop, not automatic subject detection. Inspect edges and nearby lettering: a crop that removes a price, logo or essential part of a document changes more than its appearance.
References: MDN — Aspect-preserving contain and cover, and stretched fill
The right dimensions still need a preview
This tool works locally with still JPEG, PNG and WebP images. Animated files are outside this workflow, and enlarging the output is not a promise to recover detail absent from the original.
Keep the original and inspect the result at its intended viewing size. If the source is transparent, check the output format: JPEG uses the chosen background color rather than retaining transparency.
Example: fitting a wide picture into a square
For a 1600 × 900 source and an 800 × 800 destination, contain draws the picture at 800 × 450 with 175-pixel margins above and below. Nothing is cropped, but the picture does not fill the square.
Cover instead takes the central 900 × 900 area, omitting 350 source pixels from each side before scaling it to 800 × 800. If the product sits near an edge, contain may be the better choice even when another picture looks better cropped.