Overview
Introduction
This tool crops a uniform-thickness border off all four sides of a JPG, entirely client-side.
It's the exact inverse of JPG Border Adder, useful for undoing a border you added earlier, or trimming an unwanted frame from any JPG.
What Is JPG Border Remover?
A client-side JPG cropping tool specialized for the 'remove N pixels from every edge' case: you specify one thickness value, and the tool builds a new, smaller canvas containing only the interior pixels.
It doesn't inspect pixel colors at all; it always removes exactly the thickness you specify, regardless of what's actually drawn near the edges.
How JPG Border Remover Works
The tool computes the output size as the original width/height minus twice the requested thickness, then copies every pixel starting at (thickness, thickness) in the source into a new buffer starting at (0, 0).
If the requested thickness would leave nothing behind (output width or height less than 1), the tool rejects the request with a clear error instead of producing a broken image.
When To Use JPG Border Remover
Use it to undo a border you added with JPG Border Adder, trim a frame that came baked into a downloaded stock photo, or clean up scan artifacts along the very edge of a scanned image.
If you don't know the exact thickness and the surrounding area is a solid color, JPG Empty Space Remover's auto-detection may be a better fit.
Often used alongside JPG Border Adder, JPG Margin Remover and PNG Border Remover.
Features
Advantages
- Runs entirely client-side.
- Simple, predictable single-value input.
- Exact inverse of JPG Border Adder, so pairing the two round-trips cleanly.
Limitations
- Only removes a uniform amount from every side; use JPG Margin Remover for uneven per-side trimming.
- Doesn't detect where a border actually ends; you need to know or estimate the thickness.
Examples
Best Practices & Notes
Best Practices
- If you're unsure of the exact border thickness, try a small value first and increase it while checking the preview.
- Keep a copy of the original file; cropping is destructive to the removed pixels once downloaded.
Developer Notes
removeJpgBorder allocates an output buffer sized (width - 2*thickness) x (height - 2*thickness), then copies the corresponding interior pixels from the source, opaquely (alpha forced to 255 since JPG has no alpha channel to preserve).
JPG Border Remover Use Cases
- Undoing a border added by JPG Border Adder
- Trimming an unwanted frame from a downloaded photo
- Cleaning up a stray edge artifact from a scan
Common Mistakes
- Requesting a thickness larger than half the image's smaller dimension, which leaves nothing to crop to.
- Using this when the border is actually uneven per side; check JPG Margin Remover instead.
Tips
- Pair with JPG Border Adder to quickly preview different border thicknesses by adding then re-cropping.
- For content-aware trimming instead of a fixed amount, try JPG Empty Space Remover.