base64 menu icon with Retina resolution #314

Closed
JayBrown opened this Issue Apr 6, 2016 · 3 comments

Comments

Projects
None yet
2 participants

JayBrown commented Apr 6, 2016

Using base64 for the menu icon works great… on Macs with legacy resolutions. But is there a way to use a higher icon resolution/size for Retina displays? (I tried by simply doubling the standard 18x18 size to 36x36, but it doesn't work.)

mm2270 commented Apr 6, 2016

@JayBrown Have you tried opening the image in Preview.app and changing the resolution to 144 pixels/inch prior to making the base64 data? Don't change the dimensions, just the resolution, from the default 72 to 144. That's what I've been doing and it seems to create a high res image for display in the menu for me.

Some examples. Below are custom icons I made for some menu plugins I'm working on. First one is how they both display on a Mid 2014 MBP Retina.

retina

And how the same icons from the same plug-ins appear on a Mid 2012 MBP (with older display)

non-retina

Quite a big difference, so it seems to work OK for me using the above technique. The OS simply scales the image resolution down accordingly when its being used on a non Retina system, so the trick is to create the image data with the higher display resolution (not size) in mind, and OS X will take care of the rest.

JayBrown commented Apr 6, 2016

I've now encoded the icon at 144 ppi and 36x36 pixels. On my legacy display OS X automatically downscales to 72 ppi, which results in the necessary 18x18 pixels. I think that's what I was looking for. Thank you!

JayBrown commented Apr 7, 2016

Retina works as well. Splendid.

JayBrown closed this Apr 7, 2016

@milch milch added a commit to milch/bitbar that referenced this issue Jun 12, 2016

@milch milch Mention how to support retina icons in the README e97a136
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment