User Rating 0.0 โ˜…โ˜…โ˜…โ˜…โ˜…
Total Usage 0 times
Drop a bitmap image here or click to browse PNG, JPEG, WebP, BMP • Max 50 MB
Is this tool helpful?

Your feedback helps us improve.

โ˜… โ˜… โ˜… โ˜… โ˜…

About

Adding a border to a bitmap image is a pixel-level operation. The tool composites a new canvas of dimensions W + 2b by H + 2b, where b is the border width in pixels, then draws the source image at offset (b, b). Incorrect border application in batch workflows causes misaligned sprites, broken tiling, and print bleed errors. This tool operates entirely in the browser using the Canvas API at full source resolution. No server upload. No compression artifacts from re-encoding. It supports solid, dashed, dotted, double, and gradient border styles with optional corner radius. Output is lossless PNG or configurable-quality JPEG.

Limitations: very large bitmaps (above 8000ร—8000 px) may hit browser canvas memory limits on mobile devices. The border is rasterized into the output. It is not metadata or a vector layer. For print work, convert border width from mm to px using your target DPI: px = mm ร— DPI รท 25.4.

image border bitmap editor add border to image photo frame image padding canvas editor

Formulas

The output canvas dimensions are computed from the source image and border width:

Wout = Wsrc + 2 โ‹… b
Hout = Hsrc + 2 โ‹… b

Where Wsrc and Hsrc are original image dimensions in pixels, and b is border width in pixels. The image is drawn at canvas position (b, b).

For print-to-pixel conversion:

bpx = bmm ร— DPI25.4

Where bmm is desired border width in millimeters, DPI is target print resolution (typically 300), and 25.4 is millimeters per inch.

For rounded corners, the corner radius r is clamped:

reff = min(r, min(Wout, Hout)2)

This prevents the radius from exceeding half the shorter dimension, which would produce rendering artifacts.

Reference Data

Border StyleDescriptionUse CaseCanvas Method
SolidUniform color fill around imageGeneral framing, print marginsfillRect()
DashedRepeating dash patternDraft/proof marks, design mockupssetLineDash([12,6])
DottedRepeating dot patternDecorative frames, UI thumbnailssetLineDash([2,4])
DoubleTwo parallel lines with gapCertificate borders, formal documentsTwo strokeRect() calls
GradientColor transition from outer to inner edgeSocial media posts, creative framingcreateLinearGradient()
Rounded SolidSolid with rounded corners via arcTo()App icons, profile picturesclip() + arcTo()
FormatExtensionCompressionAlpha ChannelMax Canvas Size (typical)
PNG.pngLosslessYes16384ร—16384 px
JPEG.jpgLossy (quality 0 - 1)No16384ร—16384 px
WebP.webpLossy/LosslessYes16383ร—16383 px
Print DPI1 mm in px5 mm border10 mm border25 mm border
722.8314 px28 px71 px
1505.9130 px59 px148 px
30011.8159 px118 px295 px
60023.62118 px236 px591 px

Frequently Asked Questions

Yes. The output dimensions increase by twice the border width on each axis. A 1920ร—1080 image with a 50 px border becomes 2020ร—1180 px. The original pixel data is preserved without resampling.
Multiply your desired border in millimeters by your print DPI, then divide by 25.4. For a 10 mm border at 300 DPI: 10 ร— 300 รท 25.4 โ‰ˆ 118 px.
JPEG does not support alpha channels. Any transparent region is composited against white (or the chosen border color). Use PNG or WebP export if you need transparency preserved in areas outside the border.
The tool automatically clamps the effective radius to half the shorter output dimension. A radius of 500 px on a 200ร—300 output is reduced to 100 px, producing a pill shape rather than rendering errors.
This tool applies uniform border width on all four sides. For asymmetric padding, you would need to adjust the canvas offset manually. Uniform borders are the standard for print bleed and social media framing.
Browser canvas limits vary. Chrome and Firefox typically support up to 16384ร—16384 px total canvas area. Mobile Safari may be limited to 4096ร—4096. The tool warns if the output exceeds safe limits.