Home  /  Guides  /  What one radius does to a batch

What One Radius Does to Twelve Files

Updated 2026-11-16 · measured on 12 mixed files, 20,934,926 bytes, one radius, three output paths

The short answer

One radius is not one shape. A single 200 pixel corner radius applied to 11 readable files produced three effective radii (64, 150, 200), and the share of each image cut away ranged from 0.291% to 22.583%, a 77.605 times spread.

Across the batch the mask removed 337,776 corner pixels, 326,144 of them fully transparent and 11,632 partially transparent. Keeping them transparent cost 60,850,049 bytes in PNG, 2.907 times the input; filling them white cost 55,479,721 bytes; forced JPEG cost 12,183,190 bytes and put every corner at RGB 255, 255, 255. Twelve files went in, eleven came out.

This page measures what one rounding decision does to a folder of mixed files. For other one-in-one-out operations on the same twelve files, see the batch invert measurement, the batch grayscale measurement and the batch rotate measurement. For a rectangle applied across a folder, the batch crop measurement covers padding; for many files into one canvas, the batch merge measurement; for one file into many tiles, the batch split measurement. Adding a frame is a different operation, covered by the add-border page.

1. The batch, and how the numbers were taken

Twelve files, 20,934,926 bytes on disk, 63,016,384 pixels across the 11 that decoded. One radius, 200 pixels, was applied to every file. The margin was held at 0 for the main run, then swept separately. Every file was written three ways: a transparent RGBA PNG, a white-filled RGB PNG, and a forced JPEG at quality 90. That is 11 files x 3 output settings = 33 output files, each reopened from disk and compared pixel by pixel with the rounded image it came from.

The corner mask is a rounded rectangle drawn as an alpha channel. Each corner is a quarter circle of radius r, sampled 4x4 per pixel, so the boundary carries coverage-proportional alpha instead of a hard staircase. Where the file already had transparency, the new alpha is the product of the old alpha and the mask, not a replacement. The library caps r at half of the image's smallest dimension; that cap is where most of the variation below comes from.

What the twelve files were: two byte-identical 3000 x 4000 portrait JPEGs, one 4000 x 3000 landscape JPEG, one 3000 x 4000 grayscale JPEG, one 2000 x 1500 JPEG with an orientation tag, one 3000 x 3000 PNG, one 1200 x 800 transparent PNG, one 128 x 128 PNG icon, one 1600 x 900 WebP, one 400 x 300 six-frame GIF, one 800 x 600 16-bit grayscale PNG, and one 1,200-byte truncated JPEG. Alpha was applied with Image.putalpha on an RGBA copy; the white path used Image.alpha_composite over an opaque white canvas. The run used Pillow 13.0.0, numpy 2.5.4 and Python 3.13.14 on local files. No file left the machine.

2. One radius, three different radii

Nine of the eleven readable files were large enough to take the full 200 pixels. Each lost exactly 34,924 corner pixels, 1,156 of them partially transparent, with 17 distinct alpha values along the curve. The other two were not. The 400 x 300 animation has a shortest side of 300, so the radius was capped at 150; the 128 x 128 icon was capped at 64. Those two files also lost the fewest corner pixels, 19,760 and 3,700, yet those were the largest shares of the image, 16.467% and 22.583%.

FileInput sizeRadius usedCorner pxShare of imagePartial pxAlpha values
photo_landscape.jpg4000 x 300020034,9240.291%1,15617
photo_portrait.jpg3000 x 400020034,9240.291%1,15617
photo_square.png3000 x 300020034,9240.388%1,15617
duplicate_photo.jpg3000 x 400020034,9240.291%1,15617
exif_orient6.jpg2000 x 150020034,9241.164%1,15617
screenshot.webp1600 x 90020034,9242.425%1,15617
logo_alpha.png1200 x 80020034,9243.638%1,15617
gray_16bit.png800 x 60020034,9247.276%1,15617
gray_8bit.jpg3000 x 400020034,9240.291%1,15617
animation.gif400 x 30015019,76016.467%85617
small_icon.png128 x 128643,70022.583%37216
broken.jpgfailed to decode, skipped

Share is corner pixels divided by that file's own width x height. The same 34,924 pixels are 0.291% of the 4000 x 3000 first photo and 7.276% of the 800 x 600 grayscale file. Corner pixels means every pixel whose alpha fell below 255, including the antialiased edge band.

One radius, seven different corner shares landscape0.291% orient61.164% screenshot2.425% logo alpha3.638% 16-bit7.276% GIF16.467% icon22.583%
One 200 pixel radius, seven different shares. The longest bar is 22.583%, drawn 230 units wide; the rest are scaled to it.
Your call: if these eleven outputs are heading into a fixed card grid, the two clamped files will look rounder than the rest even though nobody changed the setting. Whether that reads as a design choice or a mistake depends on the grid, and this run cannot decide it for you.

3. The corner pixels, and what each background does to them

Of the 337,776 pixels touched by the mask, 326,144 came back with alpha 0 and 11,632 sat in between, the antialiased band. That split is the whole difference between the three output paths. A PNG can store alpha, so the transparent path kept 326,144 fully transparent pixels. A white background path flattened those same pixels to RGB 255, 255, 255. Forced JPEG did the same and then recompressed the entire image, not just the corners.

Output pathBytes writtenvs inputChanged pixelsChanged share
Transparent PNG60,850,0492.907 x00%
White-filled PNG55,479,7212.65 x00%
Forced JPEG q9012,183,1900.582 x27,114,08643.027%

Transparent PNG was the most expensive option, 60,850,049 bytes, 2.907 times the 20,933,726 readable input bytes, a 190.679% increase. Forced JPEG was the cheapest, 12,183,190 bytes, 0.582 times the input, a 41.8% drop. The gap between them is 48,666,859 bytes, 4.995 times. Adding an alpha channel to eleven previously opaque files is not free, and the corners themselves are only 337,776 pixels of 63,016,384.

Bytes written by each background choice transparent PNG60,850,049 white PNG55,479,721 JPEG q9012,183,190
Total bytes for eleven files under each background choice. The longest bar is 60,850,049 bytes, drawn 230 units wide.

4. The mask is exact; the format decides what you see

Reopening all 33 files and comparing them with the rounded image they came from separates the cut from the encoding. The transparent PNG path changed 0 pixels. The white-filled PNG path changed 0. Forced JPEG changed 27,114,086, 43.027% of the 63,016,384 written. On the 128 x 128 icon the JPEG share reached 79.486%; on the 2000 x 1500 orientation-tagged JPEG it was 46.921%.

The mask geometry itself is checkable. The area outside a quarter circle of radius r is r squared times 4 minus pi, which for r = 200 gives 34,336 pixels per image. Measured as fully transparent pixels plus half the partial band, each of the nine large files returned 34,346, a 0.028% difference. Across all eleven files the largest deviation from the analytic area was 0.092%. The staircase is being measured, not guessed.

A hard one-bit mask removes the band entirely. With no supersampling the 200 pixel radius gave 2 distinct alpha values, 34,292 fully transparent pixels and 0 partial pixels. The 4x4 version gave 17 distinct alpha values, 33,768 fully transparent pixels and 1,156 partial pixels. Smoothing does not change the corner size, it changes 1,156 pixels from a hard edge into a ramp.

5. A radius sweep, and where 50% really makes a circle

Holding the first 4000 x 3000 photo fixed and moving the radius shows where the cap bites. At 200 pixels the corner share was 0.291%. Doubling to 400 pushed it to 1.155%, and 800 to 4.598%. At 1500, exactly half of the 3000 pixel height, the share was 16.133%. Asking for 2000 changed nothing: the effective radius stayed 1500 and the share stayed 16.133%.

Requested radiusRadius usedClampedCorner pxShare of imageAlpha values
00no00.0%1
1010no1160.001%7
5050no2,3000.019%16
100100no8,8880.074%17
200200no34,9240.291%17
400400no138,5681.155%17
800800no551,7324.598%17
15001500no1,935,91216.133%17
20001500clamped1,935,91216.133%17

The smallest radius, 10 pixels, produced only 116 corner pixels and 7 distinct alpha values, because a 4x4 sample of a shallow curve cannot resolve many intermediate steps. On a true square, half-width rounding removes 1 minus pi over 4 of the pixels, 21.46%. A rectangle at the same fraction becomes a rounded strip, not a circle.

Requested radius vs radius actually used 10 px10 px as set 50 px50 px as set 200 px200 px as set 400 px400 px as set 800 px800 px as set 1500 px1500 px as set 2000 px1500 px clamped
Requested radius against the radius actually used. At 2000 pixels the gold bar is clamped back to 1500, so the two rows are identical.

6. Margin is a second global number, and small files pay more

The margin setting adds background pixels around the image rather than cutting any away. On the first photo, 0 pixels of margin kept the canvas at 4000 x 3000 and 12,664,789 bytes. At 100 pixels the canvas became 4200 x 3200, 1,440,000 added pixels, 12.0% more canvas, and 12,733,889 bytes. The bytes barely move because a uniform transparent border compresses well; the pixel count does not.

The margin series is a separate re-encode that recomputes the corner alpha in floating point before padding the canvas, so its 0 pixel row is not the byte-identical twin of the main run: 12,664,789 bytes here against 12,663,585 bytes for the same photo in the main run. Both are measured files on disk. The margin comparison uses only this series, row against row.

Margin (px)CanvasAdded pixelsGrowthPNG bytes
04000 x 300000.0%12,664,789
104020 x 3020140,4001.17%12,670,615
254050 x 3050352,5002.938%12,680,943
504100 x 3100710,0005.917%12,708,612
1004200 x 32001,440,00012.0%12,733,889

Apply one 20 pixel margin to the whole folder and the same absolute number becomes a 2.347% pixel increase on the large photos and a 72.266% increase on the 128 x 128 icon, which grows to 168 x 168. If the outputs need to share a canvas size, a shared margin does not create that uniformity.

Your call: a margin that looks like a hairline on a 4000 pixel photo is a thick frame on a 128 pixel icon. If your folder mixes product shots and small badges, decide whether the margin is a design constant or a proportion, and look at the small files before exporting the batch.

7. Alpha, 16-bit depth, animation and orientation

Four behaviours sit outside the corner arithmetic and none of them shows up in a uniform thumbnail grid.

Your call: a transparent logo, a 16-bit scan, an animated thumbnail and a phone photo with an orientation tag each lost something different in the same run. Count how many of these four your own folder actually contains before choosing one output setting for all of them; the right answer depends on files no measurement here can see.

8. Twelve in, eleven out

The twelfth file was a 1,200-byte truncated JPEG claiming to be 3000 x 4000. It failed with image file is truncated (2 bytes not processed). We skipped it and kept going, so the run produced 33 output files, not 36. The readable inputs totaled 20,933,726 bytes; the difference from 20,934,926 is that one file. No error surfaced in the count of outputs.

9. Timing, and whether it repeats

The 33 output files took 14,508.8 ms of mask and save work. Building masks cost 303.52 ms, 2.092%; writing files cost 14,205.27 ms, 97.908%, or 46.802 times as much. A second full run of all three paths produced byte-identical files, with the combined rerun tree hashing to SHA-256 e650b2aa0e800ecf on both runs. The cut is nearly free compared with encoding, and it repeats exactly.

What was not measured

We did not test per-corner radii, quadratic or circle rounding modes, a background colour other than white, CSS-only rounding that leaves the file untouched, or any browser-based tool. We did not measure how any online service interprets a radius given as a percentage; those readings come from published interfaces, not from running them. We did not resize the images, reinsert EXIF tags, or add a drop shadow. The figures come from eleven local files, one radius and one margin. A different radius or a different folder changes every percentage here. We also did not test a second supersampling factor; all antialiasing numbers are from 4x4 sampling.

Questions and answers

Which format keeps the corners transparent?

PNG and WebP keep the corners transparent; JPEG cannot hold an alpha channel, so its corners must be filled. In the batch, the transparent PNG path wrote 326,144 fully transparent corner pixels across 11 files and cost 60,850,049 bytes, 2.907 times the 20,933,726 readable input bytes. The white-filled PNG path cost 55,479,721 bytes. Forced JPEG cost 12,183,190 bytes, 0.582 times the input, and every measured corner pixel came back at RGB 255, 255, 255. Transparency is the expensive option here: PNG was 4.995 times the JPEG byte total.

Does one radius cut the same fraction from every image?

No. A single 200 pixel radius removed 34,924 pixels from each of the nine large files, but that identical count was 0.291% of a 4000 x 3000 photo and 7.276% of an 800 x 600 grayscale file. Two files were smaller than twice the radius, so the radius was clamped to half their shortest side: 150 on the 400 x 300 animation and 64 on the 128 x 128 icon. Across the batch the corner share ran from 0.291% to 22.583%, a 77.605 times spread, with three different effective radii from one setting.

Why do my rounded corners look rough?

A hard, one-bit mask has only two alpha values, 0 and 255, so the curve is a staircase. With 4x4 supersampling the same 200 pixel radius produced 17 distinct alpha values and 1,156 partially transparent edge pixels on each large file, out of 34,924 corner pixels. The hard mask produced 0 partial pixels, 2 distinct alpha values and 34,292 fully transparent pixels. Smoothing adds an edge band, not a bigger corner.

Will rounding reduce image quality?

The mask itself did not. Saved as PNG, both the transparent path and the white-filled path changed 0 pixels out of 63,016,384 against the in-memory rounded image. Forced JPEG quality 90 changed 27,114,086 pixels, 43.027% of the batch. On the 128 x 128 icon that share reached 79.486%. The cut is exact; the encoding is what moves pixels.

What does Margin (px) do?

It adds a border of background pixels around the image, growing the canvas by twice the margin in each direction. On the 4000 x 3000 first photo, a 100 pixel margin produced a 4200 x 3200 canvas, 12.0% more pixels, and raised the transparent PNG from 12,664,789 to 12,733,889 bytes. The same 20 pixel margin applied across the batch grew the large photos by 2.347% but the 128 x 128 icon by 72.266%, taking it to 168 x 168. A margin is a second global number with a very different cost on small files.

Will rounding corners change the image size?

Not by itself. With the margin at 0, all 33 output files kept their input width and height, including the 128 x 128 icon. Only the margin setting changes the canvas. What does change is the byte count: the transparent PNG total was 60,850,049 bytes against 12,183,190 for forced JPEG, because adding an alpha channel to 11 previously opaque files is not free.

Can I round image corners on a JPG?

Yes, but the round-trip is not lossless. A JPEG has no alpha channel, so the mask is applied to an RGBA copy and the result is flattened onto a solid background before it can be saved as JPEG. In this batch that flattening put every corner pixel at RGB 255, 255, 255, and re-encoding changed 46.921% of the pixels in the 2000 x 1500 orientation-tagged JPEG. Save as PNG if you need the corners to stay transparent.

How do I make a circular image?

Use a square and set the radius to half its width. The library caps the radius at half of the smallest dimension, so a 2000 radius requested on the 4000 x 3000 first photo was clamped to 1500 and produced exactly the same 16.133% corner share as a 1500 radius. A true square at half-width removes 1 minus pi over 4 of its pixels, 21.46%. Rectangles at the same fraction become rounded strips, not circles.

Does a rounded-corner batch repeat exactly, and where does the time go?

It repeats. Two independent full runs of all three output paths produced 33 byte-identical files each, both hashing to SHA-256 e650b2aa0e800ecf. The measured run took 14,508.8 ms: 303.52 ms, 2.092%, building masks and 14,205.27 ms, 97.908%, writing files, or 46.802 times as much. 12 files went in and 11 came out; one 1,200-byte truncated JPEG failed to decode and produced no output at all.

Related measurements on the same twelve files: what one rectangle does to a batch, what one split button does, and what one combine button does. For a single-file crop, the photo cropper measurement covers what is thrown away; the crop image page does the cut locally. Batch flipping is a different operation with its own page.

See all free image tools and measured guides