FLXCode Round Image Corners

FLXCode apps

Appearance

Round Image Corners

Open a picture, drag the corner size, save. Corners can be round, squircle or cut, and you can pick which of the four change.

or drop it here, or paste with Ctrl+V

JPG, PNG, WebP, HEIC, AVIF, GIF and BMP, up to 25 megapixels. Nothing is uploaded.

Works offline: load this page, edit one picture, turn off Wi-Fi, edit more. A JPG has no see-through areas, so they turn white.

Nothing you open or type is uploaded. How we count What this tool keeps and sends.

Problem or idea? Email us

How to round the corners of a picture

  1. Choose a picture, or drop or paste one. It stays in this tab.
  2. Drag Corner size. Try "Avatar circle" for a round profile picture.
  3. Switch single corners off if you want only the top or only one side rounded.
  4. Save as PNG to keep the corners see-through. For a JPG pick a colour for outside the corners first.

How a corner is cut

The corner size is a percent of half the shorter side, rounded to whole pixels. At 100% a square picture becomes a circle, a wide one a pill. Only the four r × r corner squares change.

Inside a corner square, u and v are the distances from the point r pixels in from both edges. A pixel stays when |u|^n + |v|^n is at most r^n. With n = 2 that is a circle, with n = 4 a squircle (a superellipse), with n = 1 a straight cut.

An edge pixel is only partly inside, so it is tested at 16 points (4 × 4). The new alpha is the old alpha times the points inside, divided by 16. That is why the edge is smooth and not stair-stepped.

The curve is cut from the picture, so nothing is scaled. The squircle is the plain n = 4 curve, not the continuous curve of any phone maker.

r = round(percent × min(W, H) / 200)

inside |u|^n + |v|^n ≤ r^n n = 2, 4 or 1

alpha = ⌊(alpha × points + 8) / 16⌋ points = 0 to 16

What the corner size means in pixels

Three picture sizes, five settings. Whole pixels, from the same code as the tool.

Corner size1080 × 10804000 × 3000800 × 600
5%27 px75 px15 px
10%54 px150 px30 px
20%108 px300 px60 px
50%270 px750 px150 px
100%540 px1500 px300 px

The shorter side sets the size, so a wide photo and a square one with the same short side get the same corner.

One corner, pixel by pixel

A white 12 × 12 picture at 100%. Each number is the alpha of one pixel in the top left corner square (255 is solid, 0 is gone). Three curves, same radius of 6.

RowRoundSquircleCut
row 00 0 0 112 207 2550 128 207 255 255 2550 0 0 0 0 159
row 10 16 207 255 255 255128 255 255 255 255 2550 0 0 0 159 255
row 20 207 255 255 255 255207 255 255 255 255 2550 0 0 159 255 255
row 3112 255 255 255 255 255255 255 255 255 255 2550 0 159 255 255 255
row 4207 255 255 255 255 255255 255 255 255 255 2550 159 255 255 255 255
row 5255 255 255 255 255 255255 255 255 255 255 255159 255 255 255 255 255

The squircle keeps more of the corner than the circle, the cut keeps the least.

What this does not do

  • The radius is whole pixels. A circle on an odd-sized square can be a hair off true round.
  • There is no border or outline. For a frame, add it with another tool before rounding.
  • The squircle is n = 4. It is close to what app icons look like but it is not any company's exact shape.
  • A JPG cannot be see-through. Choose a colour for outside the corners, or save as PNG.
  • Up to 25 megapixels. Picture size does not change, only the corners.

Next: crop to a square first · set the pixel size

FAQ

How do I make a circle profile picture?

Crop the picture to a square first, then press "Avatar circle". On a picture that is not square 100% makes a pill shape, not a circle.

Why are the corners white in my JPG?

A JPG has no see-through part. Save as PNG to keep the corners clear, or pick a colour for outside the corners that matches the page you will put it on.

How do I round only the top corners?

Use "Top corners only", or switch off Bottom left and Bottom right. Each corner is separate.

What does 20% mean in pixels?

Twenty percent of half the shorter side. On a 1080 × 1080 picture that is 108 px. The first table above shows more sizes.

Is the squircle the same as an iPhone icon?

Close, not equal. Here it is the curve with x to the 4th plus y to the 4th. Apple uses a smoother blend, and this page does not copy it.

More from FLXCode

  • Crop ImageCrop a photo with drag handles, arrow keys or exact pixels. Presets for 1:1, 4:5 and 16:9. Nothing is uploaded.
  • Image ResizerResize photos by pixels, percent or preset for Instagram and email. Batch and zip. Nothing is uploaded.
  • Add Shadow to ImageAdd a soft or hard drop shadow to a picture or PNG cut-out. See-through or on a colour. Nothing is uploaded.
  • Change Image ColorSwap one colour in a picture, or shift the colours of the whole thing. Nothing is uploaded.

Share Round Image Corners