How can I specify a transparent colour for an ICO

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

Moderators: XnTriq, xnview

Post Reply
MikeLewis
Posts: 5
Joined: Tue Jul 04, 2006 5:13 pm

How can I specify a transparent colour for an ICO

Post by MikeLewis » Tue Jul 04, 2006 5:17 pm

Hello.

I have an image that I want to use as an icon (an ICO file). How can I specify which colour to make into a transparent background?

(If necessary, I can create the image as a GIF before saving it as an ICO.)

Thanks in advance.

Mike

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

Re: How can I specify a transparent colour for an ICO

Post by XnTriq » Tue Jul 04, 2006 6:10 pm

Hi Mike!
MikeLewis wrote:(If necessary, I can create the image as a GIF before saving it as an ICO.)
Exactly, that's how it's done. The icon gets assigned the GIF's transparency (if any).

MikeLewis
Posts: 5
Joined: Tue Jul 04, 2006 5:13 pm

Post by MikeLewis » Tue Jul 04, 2006 6:19 pm

Hi XnTriq,

Thanks for your reply.
The icon gets assigned the GIF's transparency (if any).
OK, so my next question is: How do I assign the GIF's transparency?

Mike

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

Post by XnTriq » Tue Jul 04, 2006 6:45 pm

Last edited by XnTriq on Tue Jul 04, 2006 7:55 pm, edited 1 time in total.

MikeLewis
Posts: 5
Joined: Tue Jul 04, 2006 5:13 pm

Post by MikeLewis » Tue Jul 04, 2006 7:25 pm

XnTriq,

OK, let me make sure I understand this right.

I have created a GIF in my picture editor. It has two colours: pale yellow and pale blue. I want the yellow to be transparent.

I open the GIF in XnView. I go to Edit / Edit ColorMap. I see a grid of 256 colours. The closest one to the yellow looks like Index 213.

I close the ColorMap, and go to Tools / Options / Write / GIF. I tick the box "Set transparancy value to palette entry", and enter 213 into the adjacent box.

Finally, I save the GIF as an ICO. The yellow now appears to be transparent.

This seems to work fine, but I just wanted to be sure I understood it right. Is this the recommended way of doing it, or am I missing a shortcut?

Thanks for your patience.

Mike

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

Post by XnTriq » Tue Jul 04, 2006 7:55 pm

MikeLewis wrote:Is this the recommended way of doing it, or am I missing a shortcut?
As for now, I'm afraid that's the only way you can add tranparency to icons, cursors, GIFs or PNGs.

MikeLewis
Posts: 5
Joined: Tue Jul 04, 2006 5:13 pm

Post by MikeLewis » Tue Jul 04, 2006 8:03 pm

XnTriq,
I'm afraid that's the only way you can add tranparency to icons, cursors, GIFs or PNGs.
That's fine. It's not a problem. I just wanted to be sure I had got it right.

I've only just started exploring XnView. So far, I am very impressed with its features. But I've still got a lot to learn.

Many thanks for your patient help.

Mike

marsh
XnThusiast
Posts: 2443
Joined: Sun May 15, 2005 6:31 am

Post by marsh » Sat Jul 08, 2006 9:32 pm

I think transparent icons show up with black colour in XNV. So it is useful to check them with Firefox when done. It has been mentioned in French section (from what I decipher from web translator).

User avatar
Clo
XnThusiast
Posts: 4441
Joined: Sun Oct 17, 2004 4:57 am
Location: Bordeaux, France
Contact:

Grouse again !

Post by Clo » Sat Jul 08, 2006 11:12 pm

—> marsh

:) Hello B. !

- I grouse against this non-display of the transparency for icons since… bhuuuu ! Almost ten years ? Image

- In the French Thread you are talking of, I requested first a better feature to extract icons from EXEs and other files in the same painting : When you see them in the preview-list they are OK (white background), but when you choose one and get it, it's unusable the most times because that crappy black background !
- Moreover, you can't change and save an icon with a transparent BG, then the black stays and the icon is lost…
- As a minimal workaround, I suggested an option to choose the BG-colour when extracting¦processing *.ICO files…

• Further, I give a trick : make a screen shot of the preview list, and crop the icon you want…
Not handy, but better than black !
- I asked for know what is the difficulty here (if any…). Pierre answered that there no special one, but that many viewers behave the same :|
… that is not a satisfactory reply, IMHO…

• From that thread, one can get a small set of samples as various colour-depths to perform tests.
They were there for Pierre especially ;)
- He tells one can use the Win extract feature for the thumbnails, but this is a misundestanding (?), since that doesn't the trick to recover icons like said here at top.
- So, currently the issue remains…
- Aside, there are too issues to display the non-standard icon-sizes in the tool-bar (else than Win sizes 16², 32² etc.), the icons are damaged and don't look nice…
But this is another story…

:mrgreen: FR
Claude
Clo
Last edited by Clo on Sat Feb 03, 2007 8:04 am, edited 1 time in total.
Old user ON SELECTIVE STRIKE till further notice

MikeLewis
Posts: 5
Joined: Tue Jul 04, 2006 5:13 pm

Post by MikeLewis » Sun Jul 09, 2006 1:14 pm

Marsh,

You wrote:
I think transparent icons show up with black colour in XNV. So it is useful to check them with Firefox when done.
I realise that. I was checking the tranparency by dropping the images on a page with a coloured background in Frontpage.

I've been following XnTriq's advice (see above) re transparency in GIFs. So far, this has worked pretty well. But when I save the GIF as an ICO, I've been getting mixed results.

It's something that it would be nice to see improved in a future version, but right now it's a lot better than anything I've tried before.

Mike

Post Reply