Convert BMP with magenta to transparent PNG

Ask for help and post your question on how to use XnView Classic.

Moderators: helmut, XnTriq, xnview

Post Reply
Frede
Posts: 1
Joined: Wed Nov 24, 2010 12:50 pm

Convert BMP with magenta to transparent PNG

Post by Frede »

Hi,

I am trying to convert a 24bit BMP with magenta as the "transparent" color to PNG with transparency. Since I several thousand images I try to do this using batch processing using version 1.97.8

First I do a transformation to 256 colors using Convert/Convert to Colours to 256 colors
Second I set the format to PNG in the conversion and set the option "Set the transparency value to palette entry" to 0.

This will work for 9 out of 10 times. The BMP magenta is replaced with transparency in the converted PNG. This is because the magenta color index almost always turn out to be 0. However, in some instances the magenta color is NOT at index 0 and therefore it is not set to be the transparent color in the PNG file either.

Is there any way to do what I want i.e. always have magenta be transparent in the converted image?
Ideally you would want to be able to select a specific color as the transparent color or add an option to the replace color transformation so that you can replace a specific color with transparency. Of course transparency is not valid for all file formats since it's not supported on all formats.

Thanks
Frede
User avatar
XnTriq
Moderator & Librarian
Posts: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Convert BMP with magenta to transparent PNG

Post by XnTriq »

Doesn't NConvert have an option for loading a fixed palette in Microsoft and/or Jasc format from file?
  • Jasc Paint Shop Pro v9.01:
    Image
  • Ulead GIF Animator v5.05:
    Image
Post Reply