PNG Resizing Transparency Issue
Moderators: XnTriq, helmut, xnview, Dreamer
-
- Posts: 5
- Joined: Thu Jun 17, 2021 2:49 pm
PNG Resizing Transparency Issue
Hi, I'm running into a problem where when I attempt to batch resize png images with transparent backgrounds, some of them are converting with green or black backgrounds instead and I cannot figure out why. I am not doing anything fancy with them other than increasing their size enough to work with my mapmaking software, and the bulk of my map assets convert just fine, so I am doubly at a loss.
My settings for conversion are a simple resize from 100% to 142.86% with everything else left at default.
I have tried restarting the software, restarting my system, updating drivers, re-downloading the image pack, re-running the conversion several times with various settings... all to no effect.
Does anyone have any thoughts for me on this? I really need my transparent backgrounds to properly build maps. Thanks!
My settings for conversion are a simple resize from 100% to 142.86% with everything else left at default.
I have tried restarting the software, restarting my system, updating drivers, re-downloading the image pack, re-running the conversion several times with various settings... all to no effect.
Does anyone have any thoughts for me on this? I really need my transparent backgrounds to properly build maps. Thanks!
-
- Author of XnView
- Posts: 39863
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
-
- Posts: 5
- Joined: Thu Jun 17, 2021 2:49 pm
-
- Posts: 233
- Joined: Sat Oct 08, 2005 4:10 pm
Re: PNG Resizing Transparency Issue
Post one that is giving you fits. I would guess attaching it rather than inline would be best
--
Rick
Rick
-
- Posts: 5
- Joined: Thu Jun 17, 2021 2:49 pm
Re: PNG Resizing Transparency Issue
Okay here is the before and after as previewed in batch converter:
Before: https://ibb.co/vQH3H7G
After: https://ibb.co/Kr0T2f8
Before: https://ibb.co/vQH3H7G
After: https://ibb.co/Kr0T2f8
-
- XnThusiast
- Posts: 3651
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
-
- Posts: 5
- Joined: Thu Jun 17, 2021 2:49 pm
Re: PNG Resizing Transparency Issue
Okay... here is one that turns green in the background when I convert it: https://ibb.co/CWk8HcD
And here is one that converts fine: https://ibb.co/rcFPPTr
Neither image has been converted yet. Both are PNG. And both are from the same collection of images I'm working with.
And here is one that converts fine: https://ibb.co/rcFPPTr
Neither image has been converted yet. Both are PNG. And both are from the same collection of images I'm working with.
-
- Moderator & Librarian
- Posts: 6183
- Joined: Sun Sep 25, 2005 3:00 am
- Location: Ref Desk
Re: PNG Resizing Transparency Issue
According to TweakPNG, …
Please make sure to use v0.98.2 or later.
- 1344939-barbican-controls-down-ns-2x2.png is a 24-bit (truecolor) PNG + alpha channel = 32-bit (RGBA),
- 1344899-barbican-1a-20x9.png is an 8-bit (indexed/palette-based) PNG with “cheap alpha” transparency.
Please make sure to use v0.98.2 or later.
-
- Posts: 5
- Joined: Thu Jun 17, 2021 2:49 pm
Re: PNG Resizing Transparency Issue
YES! That worked perfectly! Oh my god, thank you SO MUCH! I am definitely going to share this for others having the same problem! You are the literal best! :XnTriq wrote: ↑Fri Jun 18, 2021 3:45 am According to TweakPNG, …
Due to a limitation in XnView's library, an additional action (Image → Change color depth → 32 bits) is neccessary during batch conversion (prior to Image → Resize) when you're dealing with “cheap alpha”. This extra step will ensure that transparency is preserved in all input files upon resizing.
- 1344939-barbican-controls-down-ns-2x2.png is a 24-bit (truecolor) PNG + alpha channel = 32-bit (RGBA),
- 1344899-barbican-1a-20x9.png is an 8-bit (indexed/palette-based) PNG with “cheap alpha” transparency.
Please make sure to use v0.98.2 or later.

-
- Moderator & Librarian
- Posts: 6183
- Joined: Sun Sep 25, 2005 3:00 am
- Location: Ref Desk
-
- Moderator & Librarian
- Posts: 6183
- Joined: Sun Sep 25, 2005 3:00 am
- Location: Ref Desk
Re: PNG Resizing Transparency Issue
… and thanks for spreading the gospel!
- Converting Roll20 Assets for Dungeon Painter Studio
“This guide outlines the process I use to most efficiently convert large numbers of Roll20 marketplace assets for use with Dungeon Painter Studio. In it, I show what programs I use and how I configure them in order to convert several hundred assets at a time, with little to no loss of quality.”
-
- Posts: 63
- Joined: Sun Aug 05, 2007 7:17 pm
Re: PNG Resizing Transparency Issue
I had to go dig out my ancient forum account after running into this issue when trying to convert several thousands of PNGs into WebP that are already organized into many subfolders. The issue however is that, despite the images using "cheap" transparency, setting the bit depth to 32bit before converting does not solve the issue - perhaps because these are images with more than 256 colors?
This is with the Linux 64bit version of XnView MP v0.98.4 and, for reference, Paint.NET on my Windows PC handles the transparency in the offending PNGs without issue... but Paint.NET lacks the batch-conversion process that I need.
I've attached an example of one of the offending PNGs (it's a game sprite that normally is overlayed onto the character's full-body sprite; speaking of which, the game itself handles the transparency fine if the PNGs are left as-is but I'm trying to convert to WebP to reduce file size).
This is with the Linux 64bit version of XnView MP v0.98.4 and, for reference, Paint.NET on my Windows PC handles the transparency in the offending PNGs without issue... but Paint.NET lacks the batch-conversion process that I need.
I've attached an example of one of the offending PNGs (it's a game sprite that normally is overlayed onto the character's full-body sprite; speaking of which, the game itself handles the transparency fine if the PNGs are left as-is but I'm trying to convert to WebP to reduce file size).
You do not have the required permissions to view the files attached to this post.
-
- XnThusiast
- Posts: 3651
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: PNG Resizing Transparency Issue
You would naturally prefer an XnView MP solution
but I think if you search online, there are possibly multiple plug-ins that add batch processing to Paint.Net...

-
- Posts: 63
- Joined: Sun Aug 05, 2007 7:17 pm
Re: PNG Resizing Transparency Issue
I found three plugins, two of which have been abandoned with dead download links and require the quite old v3.x of Paint.NET while the one remaining plugin that does support Paint.NET 4.x is only made available in source code - and while I'm a computer geek, coding is basically my one weak point (hardware is my specialty) so I wouldn't even know where to start with regards to compiling from source.
Also Paint.NET only works on Windows, and my "many-cores workstation PC" is running Linux which is where the preference to use XnView MP comes in. That said, it being Linux probably means that there's some fancy method using the terminal to batch-convert all of those PNGs to WebP using some CLI program - I should try asking one of my Linux guru buddies that similarly uses WebP for game sprites.
Amusingly in one of the threads for the old bulk plugins, they mentioned trying to use XnView's long-time arch-nemesis Irf*nView which I did actually humor myself and try - but it actually has the exact same problem that XnView has, and furthermore doesn't actually let you increase image bit depth, only decrease... and it's Windows only.
-
- XnThusiast
- Posts: 3651
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: PNG Resizing Transparency Issue
You would prefer an XnView MP solution, and as a Linux user myself now who only reluctantly boots into Windows 10 occasionally, I'm with you there!
I have used Paint.Net a few times, primarily because it is a freeware application that supports layers.
If Pierre can't immediately help you, I expect XnTrig will be able to when he logs on...

I have used Paint.Net a few times, primarily because it is a freeware application that supports layers.
If Pierre can't immediately help you, I expect XnTrig will be able to when he logs on...
