> codebench_TOOL: HomeLOCAL-ONLY⌘K Switch

Square Thumbnails: When to Fit, Fill, or Stretch an Image

Turn a 720 × 480 test card into a 240 × 240 thumbnail. Use its circle and edge marks to spot padding, center cropping, and distortion in the exported pixels.

·2 min readAbout the maintainer
Three square thumbnails of one landscape image: white bands in Fit, cropped edges in Fill, and a tall oval in Exact.

A catalog asks for a square thumbnail of a round wall clock. The exported file is exactly 240 × 240 pixels, but the clock face looks like an egg. Nothing is wrong with the file dimensions. The exporter changed the photo's width and height by different amounts. A square frame doesn't require distorting the subject that goes inside it.

Start with a subject you can measure

A landscape test card with a round green disc in the center and amber L and R marks near its outer edges.
Download the original test card (PNG, 720 × 480). The disc is 180 pixels across. The edge marks tell you whether the whole frame survived.

Open the Image Resizer and load the downloaded card. Uncheck Lock before setting W and H to 240. Otherwise changing the width to 240 also changes the height to 160, preserving the original 3:2 ratio. Keep Fmt set to PNG. For each experiment below, change Mode and click Resize again; changing the menu alone doesn't replace the previous result.

Fit: keep both edge marks

Choose Fit (contain). The width shrinks from 720 to 240, a factor of one third. Applying that same factor to the height gives 160 pixels, so there are 80 rows left in the square. This tool puts 40 white rows above and 40 below. They are part of the exported PNG, not empty space around the preview.

Both edge marks survive, and the disc is still round, now 60 × 60 pixels. This is a useful choice for a product label: losing its fine print is usually worse than keeping a margin.

Fill: keep the circle, lose the sides

Choose Fill (cover). To cover the square without padding, the height shrinks from 480 to 240. At that scale the full image would be 360 pixels wide. Only the middle 240 fit: 60 output pixels' worth are removed from each side, equivalent to 120 pixels at each edge of the source. Both marks disappear. The disc stays round at 90 × 90 pixels.

For these dimensions, Crop (center) selects the same central 480 × 480 region before scaling. Neither mode knows where a face or a label is. If the subject sits near an edge, check the crop itself rather than trusting the dimensions printed above it.

Exact: keep every edge, change the shape

Choose Exact (stretch). Now the entire card fills the square. Both marks return and there are no white bands. But the disc is only 60 pixels wide and 90 tall: the horizontal scale was one third while the vertical scale was one half. That's what happened to the clock.

When a thumbnail looks wrong, check the subject and the edges separately. If the clock must stay round, rule out stretching. If its whole label must also stay visible, allow padding or give it a rectangular slot. If the design instead requires a square filled edge to edge, choose a crop deliberately while you still have the original photograph.

#images#thumbnails#aspect-ratio
> codebench $Ctrl+Enter Run