How can I specify a transparent colour for an ICO

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

Moderators: helmut, 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 »

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: 6512
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 »

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 »

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: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Post by XnTriq »

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 »

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: 6512
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Post by XnTriq »

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 »

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 »

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 »

—> 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 »

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