Batch conversion PNG w/ alpha-channel in IrfanView

4.4k Views Asked by At

I have to batch convert a couple of PNG logos, each with transparent background. I used to do it with IrfanView, but now I just can't get it to work properly. I tried different options, but every one breaks transparency in some or another way. So, if I leave all options unchecked, I basically get PNGs with background filled with color. If I check Save Transparent Color, IrfanView either ask me about what color to make transparent or uses Main window color. But why I even have to choose color? There are no 'transparent' color in my PNGs, there are just alpha-channels, which should remain alpha and not to become white or black or whatever. Sure, I can choose some harsh-pink color (which my logos do not contain) as Main window color, but it feels like wrong solution.

2

There are 2 best solutions below

0
On

Don't know since when, but IrfanView can store not only PNGs with one "transparent color" (generates a tRNS chunk with the one entry set to tranparent that has the same index in the PLTE chunk as the selected color) but also PNGs with an alpha channel (resulting in larger files without PLTE or tRNS chunks).

The latter worked for me. I needed several transparent gray values, which resulted from anti-aliasing of a b/w image.

I guess that the alpha values are not taken from the input but generated somehow, as a screenshot from a browser presenting an SVG with both transparent and white background resulted in a PNG transparent in both regions.

1
On

IrfanView is simply not capable of it. This is also explained in the IrfanView forum (yes also after 10 years).