XNMP Batch convert with a transparent canvas

Ask for help and post your question on how to use XnView MP.

Moderator: xnview

keithkeithkeith
Posts: 2
Joined: Thu Oct 22, 2026 9:21 pm

XNMP Batch convert with a transparent canvas

Post by keithkeithkeith »

Hi! I've tried everything I can to export a transparent canvas to a PNG. No matter what alpha or color I set, it does not export as transparent. I must be doing something basic wrong :)

In this example, all that is yellow should be transparent. Thank you ~


Screenshot From 2026-10-22 16-19-53.png
You do not have the required permissions to view the files attached to this post.
jkm
Posts: 723
Joined: Sat May 11, 2024 12:43 am

Re: XNMP Batch convert with a transparent canvas

Post by jkm »

Welcome to the forums... I'll try and get you sorted out.
keithkeithkeith wrote: Thu Oct 22, 2026 9:25 pm I must be doing something basic wrong :)
Yes, but that's understandable, because what you need to do is not obvious.

You don't show in your post, but whatever your input is must be a file that either does not have, or does not support, transparency; like jpeg.

So in order to do a transparent canvas resize, you must first add the capability for transparency (an alpha channel) to the image data.

You must add the Change Color Depth action to your list (Add Action->Transform). This action must execute prior to the transparent canvas resize.

In the Change Color Depth action, set the depth to 32 bits, and the Alpha to 255. This will convert your existing image to one with an alpha channel, but the existing image will remain fully opaque.

Then after that, comes the canvas resize. What you have there is correct: set the alpha to 0. Then when the canvas resize happens, the alpha for the new pixels will be 0 (transparent). You should see the transparent pixels as checkerboard in the preview.

The reason your current approach fails is that the canvas resize is setting alpha for pixels that don't have an alpha channel... So nothing happens. It would be friendlier if the app gave you a warning of this, but it doesn't.

One further warning: you must ensure your output format supports the alpha channel (in XnViewMP). PNG will work.

Hopefully this helps...
keithkeithkeith
Posts: 2
Joined: Thu Oct 22, 2026 9:21 pm

Re: XNMP Batch convert with a transparent canvas

Post by keithkeithkeith »

That did it! Thank you so much!