Adding a solid color border around an image is one of the simplest ways to convert an "add text to image" intent into a finished, framed graphic. A border adds a visible rectangular frame outside the original pixels, which gives captions, screenshots, and social posts a clean margin without needing to pick a font, set a size, or position a text overlay. With the Add Border to Image tool, you choose a local JPG, PNG, or WebP, set a whole-number border from 1 to 500 pixels, pick a six-digit hex color, and download the framed result as a PNG. The canvas expands evenly on all four sides, so source pixels stay at their original coordinates and are never cropped, stretched, resampled, blurred, or covered. Because decode, drawing, and PNG encoding happen in the browser, the source file is never uploaded. The trade-off is that a border is a flat frame rather than typographic text — if you specifically need letters or characters overlaid on the image, a different tool is the better match. If you specifically need a margin, a colored margin, or a banner-style edge around an existing photo, the focused border approach is usually faster than opening a full editor.

Why a Border Can Solve an "Add Text to Image" Need
The phrase "convert add text to image" captures a real and common need: people want to put something visual on top of or around an existing photo, often before sharing it on social media, in a slide deck, or in a printed handout. Text overlays are the most familiar option, but they are not the only one. A solid border serves many of the same purposes:
- It frames a screenshot so it looks intentional inside a blog post or Notion page.
- It adds a colored edge that distinguishes a product photo from a busy background.
- It creates a "passport photo" style margin around a portrait.
- It defines a banner-style edge for use at the top of a hero section or inside a marketing email.
In each of those cases, the goal is to change the visible boundary of the image, not to render letters on top of it. A solid border is exactly that — a change of boundary — and it produces a predictable, pixel-exact result that any browser can render. Because the border is drawn outside the source rectangle, every original pixel is preserved at its original coordinate scale, which keeps screenshots crisp and avoids the softness that resampling can introduce.
If the underlying goal is to add characters, watermarks, or callouts on top of the photo, look for a text-overlay tool instead. If the underlying goal is to add a frame, a margin, or a colored edge, a border is the focused solution.
How to Add a Solid Border to an Image
Follow these steps to add a frame to a local image using the Add Border to Image tool:
- Open the tool and click to choose a local JPG, PNG, or WebP. The file stays inside the browser tab and nothing is uploaded.
- Type a whole-number border width in the border field. The tool accepts any value from 1 to 500 pixels.
- Enter a six-digit hexadecimal color in the color field (for example, #FFFFFF for white, #000000 for black, or #1E90FF for dodger blue). A malformed color value is rejected with a visible error.
- Select Add border. The tool expands the canvas, fills the new outer area with the chosen color, and draws the source image once at the border offset.
- Check the expanded dimensions shown on the result. The new width equals the source width plus twice the border, and the new height equals the source height plus twice the border.
- Confirm the result is below the 20-megapixel canvas limit and select Download to save the framed PNG to the device.
- To try a different frame, change the file, size, or color; the previous result is invalidated and its temporary Object URL is released so a stale asynchronous export cannot replace a newer choice.
Border Geometry and Output Size
The geometry of the framed output follows one simple rule: the border is added equally on all four sides, so the canvas grows by twice the border width in each direction. A 20-pixel border increases both width and height by 40 pixels, leaves every source pixel at its original coordinate scale, and positions the source at x=20 and y=20 inside the new canvas. Existing transparent pixels stay transparent inside the image; the new outer border is opaque by design.
Worked example. Take a source image that is 800 pixels wide and 600 pixels tall. With a 20-pixel border, the output width is 800 + (2 × 20) = 840 pixels and the output height is 600 + (2 × 20) = 640 pixels. The source rectangle starts at x=20, y=20 inside the new canvas. The total area added by the frame is (840 × 640) − (800 × 600) = 537,600 − 480,000 = 57,600 pixels, which is exactly the four border strips combined.
The table below summarizes the tool's officially defined boundaries. These are the inputs the tool accepts and the limits it enforces before drawing or exporting:
| Boundary | Value |
|---|---|
| Border width | Whole numbers from 1 to 500 pixels |
| Input formats | JPG, PNG, WebP |
| Input file size | Up to 25 MiB |
| Output format | PNG (always) |
| Output canvas | Up to 20 megapixels after the border is added |
| Color input | Six-digit hex (for example, #1E90FF) |
| Border sides | One equal width applied to all four sides |
Because the output is always PNG, a source JPEG is decoded and re-encoded, which can change the file size even when the pixel dimensions only grow by the border. PNGs that already contain transparency preserve it inside the original area; the new outer border is opaque.
Privacy and Local Processing
A border tool only needs the decoded pixels of the source image, so the whole pipeline can run inside a single browser tab. The Add Border to Image tool decodes the JPG, PNG, or WebP locally, allocates a canvas sized to the new dimensions, fills the expanded area with the chosen color, draws the source image once at the border offset, encodes the canvas as a PNG, and creates a temporary download URL. The browser's canvas drawImage API positions the source at x=20, y=20 for a 20-pixel border, and the canvas toBlob step turns the painted canvas into the PNG bytes that download to the device.
File bytes, decoded pixels, the canvas, and the download URL never leave the current tab. Changing the file, size, or color invalidates the previous result and revokes the replaced Object URL so a stale asynchronous export cannot replace a newer choice. Invalid dimensions, unsupported files, malformed colors, excessive border sizes, decode failures, missing canvas support, and empty PNG output all fail visibly rather than silently.
When a Border Is Not the Right Tool
A solid rectangular frame is a specific visual treatment, not a general-purpose image editor. The Add Border to Image tool does not add rounded corners, decorative patterns, gradients, drop shadows, captions, print bleed, color profiles, or vector borders. It applies one equal width to all four sides; there is no control for different top, bottom, left, or right widths. For color-managed printing, exact physical dimensions, batch processing, layered editing, or non-destructive design work, a desktop image editor remains the better choice.
For closely related browser tasks that are also outside this tool's scope, the Image Resizer changes pixel dimensions without adding a frame, while a separate text overlay step is the right path for letters, captions, and watermarks. The strength of the border tool is its focus: a flat, opaque, evenly drawn frame around the source rectangle, exported as a PNG, with predictable geometry and no upload.
For a deeper look, see How to Add Text to a GIF on Android in Your Browser.
For a deeper look, see Color in a Text to ASCII Art Generator: What to Expect.