I've tried 32x32, 64x64, and I've tried to use Photoshop to edit another app's icon into my icon to keep its size but it never works with me. It seems that my icon is double-sized and I can't get the whole icon to be visible.
Asked
Active
Viewed 9,519 times
3 Answers
10
You can append @2x after image's base filename to mark it as a high resolution image.
This was helpful for me: https://www.electronjs.org/docs/api/native-image#high-resolution-image
7
const image = nativeImage.createFromPath(
path.join(__dirname, "your-path/icon.png")
);
tray = new Tray(image.resize({ width: 16, height: 16 }));

Nabijon Azamov
- 117
- 1
- 2
5
16x16 png will work fine for Macos tray icon. You can also have @2x 32x32 png for high-resolution displays, e.g. 16x16 'tray.png' and 32x32 'tray@2x.png'.

slhck
- 36,575
- 28
- 148
- 201

Artem Vasiliev
- 2,063
- 1
- 24
- 21
-
1Yeah possibly because that API is deprecated now, https://electronjs.org/docs/api/breaking-changes#tray. I'll remove that link for clarity. – Artem Vasiliev Oct 16 '19 at 18:57