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.
Asked
Active
Viewed 4,048 times
1

Urffly
- 85
- 1
- 7
-
What is your conversion? Aren't you by chance saving the PNG in some other format that don't support transparency? (JPEG) – leonbloy Jun 23 '16 at 17:40
-
PNG to PNG. Not actually conversion, but changing sizes (because logos are quite big for web). – Urffly Jun 24 '16 at 11:42
-
Are you sure you have PNG with alpha channels, aren't the indexed (palette) ? See http://stackoverflow.com/questions/13569887/libpng-palette-png-with-alpha-or-not/13570973#13570973 – leonbloy Jun 24 '16 at 12:06
-
Same issue. PNG to PNG just resizing. Seems I cannot preserve the transparency. – JohnWrensby Sep 14 '18 at 17:30
2 Answers
0
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.

Rainald62
- 706
- 12
- 19