How do I invert the alpha channel of an image?

XnConvert Multi Platform - Windows, MacOSX, Linux

Moderators: XnTriq, helmut, xnview

User avatar
VoidsShadow
Posts: 2
Joined: Sat Feb 15, 2020 7:00 am

How do I invert the alpha channel of an image?

Post by VoidsShadow »

A discontinued application I'm still using outputs Targa images with inverted alpha channels.
XnView MP has an option for the preview pane to "use alpha channel" which fixes the image preview's opacity in XnView. However, this does not save to the image file. I will also need to fix and convert images in bulk.
User avatar
xnview
Author of XnView
Posts: 44922
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: How do I invert the alpha channel of an image?

Post by xnview »

VoidsShadow wrote: Sat Feb 15, 2020 8:33 am XnView MP has an option for the preview pane to "use alpha channel" which fixes the image preview's opacity in XnView.
By using 'alpha channel', output is good??
Pierre.
User avatar
VoidsShadow
Posts: 2
Joined: Sat Feb 15, 2020 7:00 am

Re: How do I invert the alpha channel of an image?

Post by VoidsShadow »

Unfortunately, no. Toggling the "use alpha" setting in XnView MP only affect the preview of the image, but not the file's data nor does it affect XnConvert's output.

Allow me to simplify the issue.
The source images' alpha channels are set to 100% and they need to be changed to 0%.

After weeks of trial and error, I've found a workaround in XnConvert in the Actions tab.
  • 1. Add action: "Add mask"
    2. Change mask opacity to '0'.
    3. Check "Use mask as Alpha"
    4. Add "Change color depth"
    5. Select "24 bits"
This removes all alpha data from the image and allows it to be converted to 24-bit without losing RGB data.