Page 1 of 1

How to Replace a Color with Transparent

Posted: Fri Dec 17, 2010 7:00 am
by engineerbill
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! :(

Re: How to Replace a Color with Transparent

Posted: Fri Dec 17, 2010 10:45 pm
by XnTriq
Welcome to the forum, engineerbill :-)
  1. Go to View » Display Colour Information
    » The mouse cursor turns into an eyedropper with a tooltip next to it.
  2. 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.
  3. Go to File » Export.
  4. 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.)
  5. Click on the Set transparency color... button
    and select the color with the index number you identified earlier.
  6. Save the image.

Re: How to Replace a Color with Transparent

Posted: Sun Jul 28, 2019 5:33 pm
by tomilipin
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 :|
inactivebutton.png
inactivebutton.png (122.36 KiB) Viewed 5747 times

Re: How to Replace a Color with Transparent

Posted: Tue Jul 30, 2019 3:30 pm
by XnTriq
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.
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'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...
Could you upload the TIFF file to a hosting service so we can take a look?

Re: How to Replace a Color with Transparent

Posted: Tue Jul 30, 2019 4:52 pm
by tomilipin
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

Re: How to Replace a Color with Transparent

Posted: Wed Jul 31, 2019 12:15 am
by XnTriq
tomilipin wrote: Tue Jul 30, 2019 4:52 pmAnyway, here's the file: http://wikisend.com/download/927280/Zywiec.tif
Thank you for providing a sample, tomilipin. I've filed a bug report: Transparency is lost during conversion from CMYK to RGB

Re: How to Replace a Color with Transparent

Posted: Wed Jul 31, 2019 1:23 pm
by tomilipin
Oh, so it's a bug... Well, in that case I'm glad I could help by unintentionally finding it :)
Thanks!