pngtoolskit.org
PNG and image utilities, in the browser
Say hi →

Apply an Alpha Mask

last file is the mask · white keeps, black hides · batch

Drop your images, then drop the mask last. Wherever the mask is white the image stays opaque; wherever it is black the image becomes transparent; the greys in between give you partial transparency, which is how you get a soft edge or a gradient fade. The mask is scaled to each image, so the two do not have to be the same size.

Drop images, then the mask last

The final file in the list is used as the mask

    no files
    Ready.

    Multiply, or replace

    This is the setting that catches people out. With multiply on, the new mask is combined with whatever transparency the image already had — a pixel that was already half transparent and is masked at 50% ends up at 25%. That is what you want when the image is a cut-out and you are adding a fade on top: the existing cut-out edge survives.

    With multiply off, the mask replaces the alpha channel outright. Anything that was transparent becomes as opaque as the mask says. That is the right choice when the image is a full opaque rectangle and the mask defines the entire shape, and it is the wrong choice on a PNG with an existing cut-out, because you will resurrect the background you removed.

    Which channel to read

    Brightness is the sensible default and handles any greyscale or colour mask. Reading a single colour channel is useful when the mask was generated by something that packs several masks into one RGB image — a common trick in game asset pipelines, where red, green and blue each carry a different map. Reading the alpha channel lets you copy the transparency from one image onto another, which is how you transfer a cut-out you made once onto every frame of a sequence.

    Invert is there because conventions disagree. Print and some 3D software treat black as "keep"; compositing and the web treat white as "keep". If your result comes out as the exact negative of what you intended, that is the fix, not a bug in the mask.

    FAQ

    Where do I get a mask?

    Make one. Gradient gives you a fade, Solid color plus Circle crop gives you a vignette shape, and Extract alpha pulls an existing cut-out out of a PNG as a black-and-white image you can reuse.

    Can I mask a batch with one mask?

    That is exactly how it works — every file except the last is masked with the last one. Drop twenty frames and one mask and you get twenty masked frames.

    The mask is a different size to my image.

    It is scaled to fit, with smoothing. That is convenient but it does stretch a mask of a different aspect ratio, so for anything precise, make the mask at the image's own dimensions.

    Why is the output always PNG?

    Because the point of the operation is the alpha channel, and JPG has none. Converting afterwards would throw away the work. If you need a flattened version, run the result through Background.