16 pixel icon: background is black

MAC : Xojo 2016 r4
Trying to make the Application Icon
All the sizes down to 32 seem to work fine.
But I make a custom 16 pixel png image for the 16 sizes.

When I look at that PNG in Preview or other graphic program it looks fine.

When I paste it or drag it into the 16pixel boxes in the icon editor, all the “transparent” areas are black. (rather than white)

If I build the application and look at the icon in context where it is only 16 pixels, I get these predominantly black icons because all the background pixels are black.

I have kept fumbling around with this, adding the icon etc.

Anyway, one time it just “worked”. It was not black. I have no idea why. But anyway, for now, I do not have the problem outlined above.

It has something to do with the three ways of looking at the icon: Image, Mask & Preview.

My larger icon sizes were not “transparent”. They just have true white background. The smaller 16px size icon did have a transparent background.

So the small one under Preview looks OK with the picture on the Gray/White checkerboard of transparent.
So the small one under Image looks primarily black.
So the small one under Mask looks primarily black in the areas where the picture is not background.

Hi Robert,

Images: The real image it can have white or not, transparent or not.
Masks: The mask to apply if you want part(s) of your Image be transparent, paste the Mask here.
Preview: Display the icon using the Images and Masks.

Ask if this explanation is not crystal clear.

[quote=302678:@Robert Livingston]It has something to do with the three ways of looking at the icon: Image, Mask & Preview.

My larger icon sizes were not “transparent”. They just have true white background. The smaller 16px size icon did have a transparent background.

So the small one under Preview looks OK with the picture on the Gray/White checkerboard of transparent.
So the small one under Image looks primarily black.
So the small one under Mask looks primarily black in the areas where the picture is not background.[/quote]
And that’s correct. Make sure when you’re dragging in, that you have the view set so that it shows you the composite images because otherwise you’re just setting the mask or the color data and not both.

Isn’t that the view by default ?

Thanks Emile & Greg. I think that I do “get it” now. At least sufficiently for my purposes.

This means, I believe, that you have it with Preview selected. And that does seem to be the initial state of the selection whenever you first open the Icon editor.

I was dragging PNG files in from Affinity Designer which just happened to be the graphic software that I was using to create the icon. The single PNG file, in my case at least, had a mask and a picture in place as it were. So when I drag in with Preview selected it seems to work as Greg implies.

I wonder if my earlier “problems” were related to dragging in the PNG when the Mask or Image option were selected. I do not really know. I am just happy now that I can make it work.

I do not know under what circumstances I would need or want to drag in the mask and the image separately. It implies a greater sophistication with images than I care to acquire if I do not actually need it.

If Affinity Designer allows you to save the icon in a… icns file, you will be able to drag that icns file into the icon window (the window, not any of the Canvases), Xojo IDE will fill all defined entries at once.

Robert, Lurkers,

I just fired 2016r4 (El Capitan),
created a brand new project,
click in App,
click in the App Icon area,
changed the display to Images,
drop a png image onto the 1024 x 1024 area

and… I get a black background, and I was astonished to see a black background !

Then I clicked to display the Masks,
dropped a Mask image for my icon,

And I clicked to display the Preview: I got the icon I wanted.

Nota:
I generated a cropped icon that I saved using the " - Image” suffix.
I generated a black mask of that icon and I saved it using the " - Mask” suffix.

As strange as it seems this works fine. I searched in 2016r4 documentation, but I failed to reach the icon explanation (the graphics part of the explanation, I found the part that talks about file type sets).

I apologize for any misunderstandings that could result to the reading of my previous posts here.

The project (2016r4) as saved to disk with a complete set of icons (1024 to 16) weight is 11.2MB.
No code, no window, class, etc. added, nothing else: just the App icon.