Yes: a transparent PNG stays transparent when you add a drop shadow, because pixels outside the source image and its generated shadow remain transparent in the PNG output. The qualification is that the shadow itself introduces opaque or partially opaque pixels where the source image’s alpha produces a shadow. A transparent region that the shadow does not cover is not flattened onto a white or gray background. The Add Shadow to Image tool handles this by rendering the source and its shadow on an expanded browser canvas, then downloading a new PNG. The larger canvas reserves space for blur and offset so the shadow is not clipped at the old image boundary. The visible source is drawn once more without a shadow, which keeps foreground pixels clear instead of allowing a translucent shadow pass to soften them. That makes the workflow suitable for logos, product cutouts, stickers, thumbnails, and mockups that need depth while retaining transparent surroundings. The downloaded file is a newly encoded PNG, not a byte-for-byte copy of the source, so use the exported version as your final asset.

does a transparent png stay transparent when i add shadow to image
Does a Transparent PNG Stay Transparent With a Shadow?

What remains transparent in the PNG

The key distinction is between transparency in the source and opacity added by the shadow. For a PNG with alpha, transparent portions of the source do not act like a solid rectangle when the browser renders the drop shadow. The generated shadow follows the source alpha. Areas covered by that shadow can contain new alpha values, while pixels outside both the source rectangle and the shadow footprint remain clear.

This is why the output can have a transparent, page-friendly background and a visible shadow at the same time. It also explains what “stays transparent” does not mean: the process does not promise that every pixel keeps exactly the same alpha value. Pixels in the shadow footprint are supposed to become darker or more opaque. Pixels outside that footprint remain transparent. The tool does not remove a background, detect a subject, add a border, or create a perspective floor shadow; it applies a straightforward raster drop shadow around the supplied image.

Shadow controls and exact limits

Use these exact control ranges to keep the result predictable:

Control or inputAccepted valueWhat it controls
Input fileBrowser-decodable JPG, PNG, or WebP; no larger than 25 MiB; within the displayed file and pixel limitsOne local source image
Horizontal offset-500 to 500 whole pixelsPositive moves the shadow right; negative moves it left
Vertical offset-500 to 500 whole pixelsPositive moves the shadow down; negative moves it up
Blur radius0 to 250 whole pixelsThe softness of the shadow edge
Opacity0 to 100 as a whole percentageThe visibility of the generated shadow
Shadow colorAn exact six-digit hexadecimal valueThe color of the shadow

These controls are validated before being passed to the browser’s Canvas shadow renderer. A larger blur creates a softer feather, but the exact edge can vary slightly between browser engines because Canvas blur is a browser-rendering effect rather than a print-prepress measurement.

Add a shadow to a transparent PNG

  1. Choose a local source. Select a browser-decodable JPG, PNG, or WebP file. It must be no larger than 25 MiB and within the file and pixel limits displayed by the tool. For this workflow, start with the PNG whose transparent background you want to preserve.
  2. Set the shadow controls. Enter whole-pixel horizontal and vertical offsets, set a whole-pixel blur radius, choose opacity from 0 to 100, and enter an exact six-digit hexadecimal shadow color. Use positive offsets for right and down, or negative offsets for left and up.
  3. Select “Add shadow” and verify the result. The browser expands the canvas, renders the source and shadow, and reports the exact expanded width, height, and encoded file size. Check that the preview includes the full shadow rather than the old source edges.
  4. Download the PNG. Save the generated file. The download is always a PNG and uses a name derived from the source, such as portrait-shadow.png. Its natural output resolution matches the calculated expanded dimensions, even if the on-page preview is scaled to fit the page.

If you change the source or any setting, the previous result is invalidated and its temporary download URL is revoked. Generate the result again before downloading so the file matches the current controls.

How extra canvas space prevents clipping

Each side of the output canvas receives a margin equal to twice the blur value. The side toward which the shadow moves also receives the absolute directional offset. This prevents a soft edge from being cut off and makes room for the shadow to sit outside the original rectangle.

Output width = source width + 2 × (2 × blur) + |horizontal offset|

Output height = source height + 2 × (2 × blur) + |vertical offset|

For a 40 × 20 source with a right offset of 8 pixels, an upward offset of 4 pixels, and a blur of 6 pixels:

Width = 40 + 2 × (2 × 6) + |8| = 40 + 24 + 8 = 72 pixels

Height = 20 + 2 × (2 × 6) + |4| = 20 + 24 + 4 = 48 pixels

Those extra margins are why the downloaded image can be larger than the source even when the visible picture itself has not been resized. The original image is positioned inside the expanded area rather than being allowed to cover the entire new canvas.

What stays local and what the output contains

The source is decoded, drawn, and encoded inside your current browser tab. It is not uploaded to a remote image service, and its pixels are not sent there. The output is a new PNG assembled from browser-rendered pixels. For JPG and WebP sources, that means the original compression bytes and metadata are not retained.

PNG is used because a drop shadow normally needs transparent pixels outside the source’s rectangular bounds. The browser Canvas process draws the source with the selected shadow state, then draws the source again without shadow. The second draw preserves clear foreground pixels. For more on the rendering primitives, MDN documents Canvas drawImage and Canvas shadowBlur.

The tool is deliberately scoped to a basic drop shadow. It does not claim byte-for-byte equivalence with CSS box-shadow, and it does not simulate perspective, a studio-lighting setup, or automatic subject detection. Use it when you want predictable raster shadows with local processing and explicit canvas bounds.

Preview and download checks

The preview is for visual inspection, not for judging final pixel dimensions. It may be reduced to fit the page, while the download retains the natural width and height calculated from the source, blur, and offset. The result reports the exact expanded dimensions and encoded size, so check those figures before placing the PNG in a layout.

  • Look outside the source rectangle: this is where the transparent canvas and new shadow should be visible.
  • Check every shadow edge: confirm the blur has room in the preview and is not cut off.
  • Confirm the file name and size: the download remains a PNG, and the reported encoded size distinguishes it from the source.
  • Regenerate after a setting change: stale preview results are invalidated and their temporary download URLs are revoked.

Fix common failures and unexpected results

If the tool shows an error, check the input first. It rejects invalid file types, empty files, files above 25 MiB, images whose decoded dimensions are too large, impossible output dimensions, and files the browser cannot decode. Source and expanded dimensions are checked against the site’s bounded canvas budget before allocation. Missing Canvas support and PNG encoding failures also produce a visible error rather than a silent broken download.

If the expanded image is too large for that budget, reduce the blur or offsets or work from a smaller source image. The Image Resizer is separate from this tool. If you use a smaller source image, check the new output dimensions after adding the shadow.

If the result does not look transparent, distinguish the source from the shadow footprint. A JPG has no transparent source pixels, and this tool does not remove its rectangular background. For a PNG, inspect an area outside both the source and shadow: that area should remain transparent. If you changed the source or controls after generating a result, download the newly generated version because the old result and URL have been invalidated.

Finally, do not expect identical feather pixels in every browser. Canvas shadow blur is a rendering effect, so slight engine-to-engine variation is possible. It should not be treated as a fixed prepress specification.

A simple shadow for transparent assets

For the original question, the practical answer is yes: adding a shadow does not require flattening a transparent PNG. The untouched area outside the source and generated shadow stays transparent, while the expanded PNG canvas gives the drop shadow room to render. Start with a valid local PNG, set the offset, blur, opacity, and color, then verify the reported dimensions before downloading the final asset.

If you're weighing options, Blur Image on Android: Full-Resolution PNG Steps covers this in detail.

If you're weighing options, How to Avoid Mistakes When Adding a Shadow to an Image covers this in detail.