Preserving existing alpha channels using irfanview PNG converter

irfanview

I have tried a lot of different tools and found that Irfanview gives promising results when converting to PNG's under the highest compression settings.

One issue I've encountered is when my original image has an alpha channel set. Irfanview's PNG converter provides an option called "save transparent color" which allows me to choose which color should be used as the transparent color, but this isn't the proper way to do it because the image you are sampling from only renders the RGB, and many image editors simply sets the RGB values for transparent sections (A value of 0) to (0, 0, 0) (such as paint.NET) or (255, 255, 255) (imagemagick does this)

If I set the transparent color as the black pixel, then all black pixels will be transparent, which is undesirable.

Does irfanview provide a way to automatically detect whether the source image is RGB24 or RGBA32 and automatically convert it to the appropriate format? (RGB24 => RGB24, RGBA32 => RGBA32). I have not looked into the PNGOUT plugin options as much, but the "auto" options don't seem to be working the way I think they should work, and I don't want to spend the time for it to optimize each chunk since the savings aren't that significant anyways.

(otherwise I might look deeper into imagemagick's quality options)

Best Answer

IrfanView is first and foremost an image viewing application, not an image editing application (although a number of helpful tools exist within the application). When it comes to saving the alpha channel, IrfanView is very limited. This is also explained in the IrfanView forum:

Irfanview is basically an image viewer. Alpha channel is just used to render against a background. then the alphachannel is gone. To keep the alpha channel means to use more memory and it must be handled in all image operations. This means a rewrite a lot of code.

Use different tools to preserve alpha channel during edit (like Paint.NET).

If you are primarily looking into PNG file compression I suggest you take a look at ImageOptim (if you are on a Mac), Trimage (Linux) or FileOptimizer (Windows, beware: it seems to be adware).

If you would like to use ImageMagick take a look at the alpha parameter. If I understand you correctly what you need is -alpha set.