User Rating 0.0 โ˜…โ˜…โ˜…โ˜…โ˜…
Total Usage 0 times
Drop image here or click to browse PNG, JPG, WebP, GIF, SVG, BMP
Presets:
Is this tool helpful?

Your feedback helps us improve.

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

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.

center image png maker image centering canvas resize transparent background image padding

Formulas

The centered position of the source image on the target canvas is computed as follows:

xoffset = Wcanvas โˆ’ wimg2
yoffset = Hcanvas โˆ’ himg2

When the source exceeds available space (canvas minus padding), a uniform scale factor is applied:

s = min(Wcanvas โˆ’ 2pwimg, Hcanvas โˆ’ 2phimg)

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 CaseRecommended Canvas SizeBackgroundNotes
Favicon (ICO)64 ร— 64 pxTransparentAlso export at 16, 32, 48 sizes
App Icon (iOS)1024 ร— 1024 pxSolid colorApple requires no transparency
App Icon (Android)512 ร— 512 pxTransparentAdaptive icon safe zone: inner 66%
Social Media Avatar400 ร— 400 pxSolid colorSquare aspect ratio universal
Instagram Post1080 ร— 1080 pxWhite / BrandCenter product with padding
Instagram Story1080 ร— 1920 pxGradient / Solid9:16 ratio
Twitter Header1500 ร— 500 pxBrand color3:1 ratio
YouTube Thumbnail1280 ร— 720 pxCustom16:9 ratio
E-commerce Product2000 ร— 2000 pxWhite (#FFFFFF)Amazon requires white background
Email Signature Logo300 ร— 100 pxTransparentKeep file size under 50 KB
Presentation Slide1920 ร— 1080 pxWhite / DarkFull HD standard
Sprite Sheet Cell128 ร— 128 pxTransparentPower-of-two sizes preferred
Watermark OverlayMatch target imageTransparentCenter logo at 10โˆ’20% opacity
Print (A4 @ 300 DPI)2480 ร— 3508 pxWhite210 ร— 297 mm
Print (Letter @ 300 DPI)2550 ร— 3300 pxWhite8.5 ร— 11 in

Frequently Asked Questions

Ensure the background option is set to "Transparent" before exporting. If you selected a solid color, the canvas fills with that color before drawing the image. Also verify your source image actually contains an alpha channel. JPEG sources have no transparency - only PNG, WebP, or GIF inputs preserve alpha data.
By default, the tool does not upscale. The image is drawn at its native resolution and centered with empty space around it. If you enable the "Allow upscale" option, the image will be scaled up to fill the available area (canvas minus padding), which causes visible interpolation artifacts on raster images. For pixel art, also enable the "Disable smoothing" option to get nearest-neighbor interpolation.
The tool calculates a uniform scale factor s = min((W โˆ’ 2p) / w, (H โˆ’ 2p) / h) where p is padding. The image is scaled down proportionally so it fits entirely within the canvas with the specified padding on all sides. Aspect ratio is always preserved.
Yes. The canvas element is created at the exact pixel dimensions you enter. The exported PNG file will be exactly that size. Note that very large canvases (above 8000 ร— 8000 px) may fail on mobile browsers due to memory constraints. Desktop Chrome supports up to approximately 16384 ร— 16384 px.
This tool processes one image at a time. For batch workflows, you would need to repeat the process for each file. The settings (canvas size, padding, background) persist across sessions via localStorage, so you only configure once and then swap images.
Padding defines a minimum margin on all four sides. The available drawing area becomes (W โˆ’ 2p) ร— (H โˆ’ 2p). The image is centered within this reduced area. If the image already fits within this area at native size, it is simply offset. If it exceeds it, the scale factor shrinks the image to fit.