A border is added to an image by drawing the original picture onto a larger canvas with equal offsets on every side — a 20-pixel border increases both the width and the height by 40 pixels (20 on the left, 20 on the right, 20 on the top, 20 on the bottom) and places the source picture at coordinates x=20, y=20 inside the new PNG. Adding a border with a browser tool means picking a whole-number width from 1 to 500 pixels, choosing a six-digit hex color, and letting the canvas expand equally on every side before you download the result. The original picture is composited once onto that expanded canvas at the border offset, leaving every source pixel at its original coordinate scale. The canvas first fills with the chosen opaque color and then draws the decoded source once at the border offset, so the source is never overdrawn by the border and existing transparent pixels inside the picture stay transparent. The tool never crops, stretches, resamples, blurs, or covers the original image — it only adds solid pixels around the outside and outputs a PNG that you can save straight from your browser tab.

What Adding a Border to an Image Actually Does
What "add a border" means in plain terms is that the picture keeps its full content, but a solid-color rectangle is placed around the outside of it. The picture itself is not cropped, stretched, or resampled — the border is a separate layer of opaque pixels that the canvas fills before it draws the source. The end result is a wider and taller file with the original artwork preserved exactly in the middle.
This is different from resizing, which changes the actual pixel dimensions of the picture. A border changes the canvas; the picture inside the canvas is untouched. It is also different from adding a stroke to an image, which is the same visual idea — a solid frame around the picture — but is usually applied as an effect inside an editor like Adobe Illustrator or Photoshop. The Add Border to Image tool gives you the same outcome with three inputs: a file, a width, and a color.
Two visual properties follow from how the canvas is filled. First, the border is always exactly the same thickness on every side, because the formula adds the border twice — once to each axis — and the source is centered by offset, not by alignment math. Second, any transparency that already exists inside the source picture survives the trip, because the border lives only in the canvas pixels outside the source rectangle, never inside it.
Inside Adobe Illustrator
Adobe Illustrator handles borders through strokes, swatches, and the Appearance panel rather than through a single one-click frame button, which is why many searches for "add border to image illustrator" turn into multi-step workarounds. The most common approach in Illustrator follows a short, repeatable sequence.
First, place or open the picture you want to frame in an Illustrator document. Then draw a rectangle with the Rectangle tool that is sized to (image width + 2 × border) on the horizontal axis and (image height + 2 × border) on the vertical axis. Fill the rectangle with the solid color you want for the border and send it to the back of the layer stack so the picture sits on top of it. Finally, center the picture on the rectangle using the Align panel so the visible border is equal on all four sides. When you need the frame baked into the image file itself rather than as a separate shape, export the artwork as a PNG or JPG with Art Optimized (for vector content) or PNG transparency turned on.
For users who only want a solid rectangular frame, that workflow is heavier than it needs to be. It also requires a paid license and a saved .AI project file for what is, in the end, a single rectangle behind a single picture. The same task done in Illustrator or directly in the browser ends with a PNG in both cases, but the browser path skips the install and the project file entirely.
Why Many Users Move to a Browser Tool
A browser tool that runs locally is the right fit when the task is exactly what was just described: a solid-color frame, a known width in pixels, and a PNG to download. Nothing is uploaded, the file stays in the current tab, and the result is a flattened PNG that already has the border as part of the canvas. There is no document to save, no stroke panel to find, no rectangle to align, and no export step beyond a single download button.
The trade-offs are real, though. A browser tool of this kind does not give you rounded corners, gradients, drop shadows, vector borders, decorative patterns, or print bleed. If any of those are part of the goal, the task has moved beyond what a flat solid frame can express, and the right tool is a desktop editor with layers and effects. For a plain rectangular frame, a browser tool is faster to use, easier to repeat, and removes the need to install a multi-gigabyte application just to draw one rectangle.
Local-only processing also matters for privacy and repeatability. Because decoding, drawing, encoding, and the temporary download URL all stay in the current browser tab, the source file does not leave the device. Changing the file, the border width, or the color invalidates the previous result and releases the old download link, so the workflow never leaves a stale PNG behind on a server.
Add a Border to an Image in Your Browser
- Open the Add Border to Image tool in your browser tab.
- Choose a local JPG, PNG, or WebP from your computer. The file must fall within the 25 MiB input limit and use one of those three formats.
- Enter a whole-number border width from 1 to 500 pixels in the width field.
- Pick a solid color using the color picker or by typing a six-digit hex value such as #000000 or #FFFFFF.
- Select Add border. The canvas expands equally on every side; the new width is the original width plus twice the border, and the new height is the original height plus twice the border.
- Verify the expanded dimensions shown next to the preview, then download the result. The file is a PNG with the border baked in as opaque canvas pixels around the original picture.
If the output canvas would exceed 20 megapixels, the tool shows a visible failure rather than producing an oversized file. In that case, lower the border width or downscale the source with the Image Resizer before adding the frame.
How the Border Reshapes the Canvas
The relationship between the border width and the final canvas size is fixed: the new width equals (source width + 2 × border) and the new height equals (source height + 2 × border). The source picture is drawn at offset (border, border), so for a 20-pixel border the picture sits at x=20, y=20 inside a canvas that is exactly 40 pixels wider and 40 pixels taller than the source. This is the standard canvas-draw pattern documented on MDN's CanvasRenderingContext2D.drawImage page, and the result is then handed to HTMLCanvasElement.toBlob for the PNG export.
Three things follow from that formula. The border is always equally thick on all four sides — there is no way to make the top thicker than the bottom in this tool. The output canvas is rejected if it exceeds 20 megapixels, which can happen with very large sources and very wide borders. The PNG file size almost always grows, because the border is encoded as fresh pixels and PNG compression depends on how much detail lives in each region; a wide flat-color border compresses well.
For quick reference, the formula in plain text is:
Final width = source width + (2 × border) Final height = source height + (2 × border)
| Scenario | Border width | Effect on canvas |
|---|---|---|
| Hairline frame | 1 pixel | Adds 2 pixels to each axis; almost invisible on screen |
| Standard photo frame | 20 pixels | Adds 40 pixels to each axis; matches a thin matte border |
| Poster-style frame | 100 pixels | Adds 200 pixels to each axis; visible at typical print sizes |
| Maximum border | 500 pixels | Adds 1000 pixels to each axis; can trip the 20 MP canvas ceiling on large sources |
For a different read on the same workflow, the guide to adding a solid border to a JPG, PNG, or WebP image walks through the same tool from a format-focused angle.
When to Keep Using a Desktop Editor
The browser tool draws one solid frame and exports one PNG. Anything beyond a single flat rectangle pushes the task back into a desktop editor, and it helps to know where the line sits before you start:
- Rounded corners — use an image tool that supports corner radius, or a vector editor with a corner-radius property.
- Gradients, shadows, patterns, or double borders — use Illustrator's Appearance panel or Photoshop's layer styles.
- Color-managed printing with exact physical dimensions — use a tool that supports ICC profiles and an explicit DPI setting.
- Batch processing — use a desktop script, Photoshop action, or Illustrator batch processor that loops over files.
- Layered, non-destructive editing — keep the source as a layer with an adjustment that can be edited later.
The single-picture, single-frame case is exactly what a browser tool is built for, and for that case it removes the install step without removing the precision. If the goal grows past one solid color on one side, the desktop editor is still the right next stop.