Centered PNG Maker
Center any image on a custom-sized transparent or colored canvas and export as PNG. Adjust padding, background, and dimensions client-side.
About
Placing an image at the exact geometric center of a canvas sounds trivial until you deal with aspect ratios, sub-pixel rounding, and transparency channels. A misaligned icon in a favicon set or an off-center product photo on an e-commerce listing creates visual noise that erodes perceived quality. This tool computes the horizontal offset as x = (W โ w) รท 2 and vertical offset as y = (H โ h) รท 2, where WรH is the target canvas and wรh is the source image. All rendering happens in-browser via the Canvas API with full alpha channel support.
The tool handles edge cases where the source image exceeds the target canvas by scaling down proportionally using a factor s = min(Wavail รท w, Havail รท h). No server upload occurs. Your images never leave your device. Limitation: output quality depends on browser Canvas implementation, which uses bilinear interpolation by default. For pixel art, disable smoothing via the provided option.
Formulas
The centered position of the source image on the target canvas is computed as follows:
When the source exceeds available space (canvas minus padding), a uniform scale factor is applied:
If s โฅ 1, the image is not enlarged (unless upscaling is enabled). The final draw dimensions become wdraw = wimg โ s and hdraw = himg โ s.
Where: Wcanvas = target canvas width in px, Hcanvas = target canvas height in px, wimg = source image width, himg = source image height, p = padding in px, s = scale factor (clamped to 1 when upscaling is off).
Reference Data
| Use Case | Recommended Canvas Size | Background | Notes |
|---|---|---|---|
| Favicon (ICO) | 64 ร 64 px | Transparent | Also export at 16, 32, 48 sizes |
| App Icon (iOS) | 1024 ร 1024 px | Solid color | Apple requires no transparency |
| App Icon (Android) | 512 ร 512 px | Transparent | Adaptive icon safe zone: inner 66% |
| Social Media Avatar | 400 ร 400 px | Solid color | Square aspect ratio universal |
| Instagram Post | 1080 ร 1080 px | White / Brand | Center product with padding |
| Instagram Story | 1080 ร 1920 px | Gradient / Solid | 9:16 ratio |
| Twitter Header | 1500 ร 500 px | Brand color | 3:1 ratio |
| YouTube Thumbnail | 1280 ร 720 px | Custom | 16:9 ratio |
| E-commerce Product | 2000 ร 2000 px | White (#FFFFFF) | Amazon requires white background |
| Email Signature Logo | 300 ร 100 px | Transparent | Keep file size under 50 KB |
| Presentation Slide | 1920 ร 1080 px | White / Dark | Full HD standard |
| Sprite Sheet Cell | 128 ร 128 px | Transparent | Power-of-two sizes preferred |
| Watermark Overlay | Match target image | Transparent | Center logo at 10โ20% opacity |
| Print (A4 @ 300 DPI) | 2480 ร 3508 px | White | 210 ร 297 mm |
| Print (Letter @ 300 DPI) | 2550 ร 3300 px | White | 8.5 ร 11 in |