
How to Replace a Color with Transparent
Moderators: XnTriq, helmut, xnview
-
- Posts: 1
- Joined: Fri Dec 17, 2010 6:35 am
- Location: Oxnard, California, USA
How to Replace a Color with Transparent
This may be a silly question, but I'm a new user. I have a Windows BMP file that contains only a 4-bit color pallette. I'd like to replace black with transparent but can't figure out how to do it. The "enable transparency" checkbox under "edit color pallette" makes it tantalizing but I just don't get it. Help! 

-
- Moderator & Librarian
- Posts: 6454
- Joined: Sun Sep 25, 2005 3:00 am
- Location: Ref Desk
Re: How to Replace a Color with Transparent
Welcome to the forum, engineerbill 

- Go to View » Display Colour Information
» The mouse cursor turns into an eyedropper with a tooltip next to it. - Move the color picker over the area of the image that you want to become transparent
and remember the index number of the color beneath the cursor. - Go to File » Export.
- Go to the tab for the format you want your image to be saved in.
(For 4-bit indexed images, that would be GIF or PNG.) - Click on the Set transparency color... button
and select the color with the index number you identified earlier. - Save the image.
-
- Posts: 4
- Joined: Sun Jul 28, 2019 5:10 pm
Re: How to Replace a Color with Transparent
Hi,
I have a very similar problem, so I'm posting a reply here - I followed your instruction, XnTriq, but the Set transparency color button is inactive when the Color mode is set to 16m. I have to choose literally any other Color mode to enable the Set transparency color button, but then the image quality is visibly worse.
Converting image from its original True Color to 32 bits doesn't help. Actually, it makes things even worse as the file size increases from 45 MB to over 60 MB.
I'm working on a TIFF file with transparent background, which shows correctly in Windows 7 generic image viewer, but in XnView the background is white - no idea why...
I'm using XnView 2.48, Windows 7. Please help
I have a very similar problem, so I'm posting a reply here - I followed your instruction, XnTriq, but the Set transparency color button is inactive when the Color mode is set to 16m. I have to choose literally any other Color mode to enable the Set transparency color button, but then the image quality is visibly worse.
Converting image from its original True Color to 32 bits doesn't help. Actually, it makes things even worse as the file size increases from 45 MB to over 60 MB.
I'm working on a TIFF file with transparent background, which shows correctly in Windows 7 generic image viewer, but in XnView the background is white - no idea why...
I'm using XnView 2.48, Windows 7. Please help

You do not have the required permissions to view the files attached to this post.
-
- Moderator & Librarian
- Posts: 6454
- Joined: Sun Sep 25, 2005 3:00 am
- Location: Ref Desk
Re: How to Replace a Color with Transparent
Unfortunately I don't have a short answer for you as there are many different types of transparency.tomilipin wrote: Sun Jul 28, 2019 5:33 pmI have a very similar problem, so I'm posting a reply here - I followed your instruction, XnTriq, but the Set transparency color button is inactive when the Color mode is set to 16m. I have to choose literally any other Color mode to enable the Set transparency color button, but then the image quality is visibly worse.
Converting image from its original True Color to 32 bits doesn't help. Actually, it makes things even worse as the file size increases from 45 MB to over 60 MB.
- XnView Forum
- How to set PNG transparency color?
- Free Adobe Photoshop Plug-Ins
- How do I save a png with transparent background
- Fails to detect 32 bit depth
- Editing an images loses its transparency
- Cant change background image completely
- PNG transparency not preserved after conversion
- Way to produce a transparent canvas?
- Batch convert to transparency?
- Elsewhere
- Patrick Hansen: PNG 8, 24, 32…what?
- Jesse O'Chapo: Developers Guide to Images
- Dave Hogue: What Are Index and Alpha Transparency?
Could you upload the TIFF file to a hosting service so we can take a look?tomilipin wrote: Sun Jul 28, 2019 5:33 pmI'm working on a TIFF file with transparent background, which shows correctly in Windows 7 generic image viewer, but in XnView the background is white - no idea why...
-
- Posts: 4
- Joined: Sun Jul 28, 2019 5:10 pm
Re: How to Replace a Color with Transparent
Hi,
I'm slowly starting to accept the white background - it doesn't ruin my project.
Anyway, here's the file: http://wikisend.com/download/927280/Zywiec.tif
I'm slowly starting to accept the white background - it doesn't ruin my project.
Anyway, here's the file: http://wikisend.com/download/927280/Zywiec.tif
-
- Moderator & Librarian
- Posts: 6454
- Joined: Sun Sep 25, 2005 3:00 am
- Location: Ref Desk
Re: How to Replace a Color with Transparent
Thank you for providing a sample, tomilipin. I've filed a bug report: Transparency is lost during conversion from CMYK to RGBtomilipin wrote: Tue Jul 30, 2019 4:52 pmAnyway, here's the file: http://wikisend.com/download/927280/Zywiec.tif
-
- Posts: 4
- Joined: Sun Jul 28, 2019 5:10 pm
Re: How to Replace a Color with Transparent
Oh, so it's a bug... Well, in that case I'm glad I could help by unintentionally finding it
Thanks!

Thanks!