17

I need to make a dmg that support both 1x and 2x background, but there seems no info about retina in hdiutil or other tools like dropdmg. I create a normal one and it apparently blurs on Retina MBP. Any one have a solution?

Xiao Xiao
  • 931
  • 8
  • 19
  • It's not the DMG that has a background, it's the folder that has a Finder background image. So if you can find info on using Retina background images for folder windows in Finder, that will tell you how to do it in a DMG. – abarnert Jun 26 '12 at 05:12
  • PS, as far as I know, the only supported ways to set a Finder background image are through the Finder's Show View Options menu item, or via AppleScript's "background picture of icon view options of theWindow", and I don't see any way to handle retina images for either one. Maybe if you set it to background.png and then add an "@2" file it'll work, but I don't have a Retina MBP to test on… – abarnert Jun 26 '12 at 05:22
  • I would test this on the latest Mountain Lion builds; odds are if it exists now, it didn't then... – Mahmoud Al-Qudsi Jun 26 '12 at 05:33
  • @MahmoudAl-Qudsi The latest Mountain Lion builds are simple dmg without backgrounds, so I think it wouldn't help. – Xiao Xiao Jun 26 '12 at 06:24
  • @abarnert yes you are right, it's all about the .DS_store file. But I don't know if it's possible to add the pic by simply writing something to that file lol – Xiao Xiao Jun 26 '12 at 06:26

2 Answers2

17

A guess: a multirepresentation TIFF file might work, see first paragraph of this Apple link. HTH.

CRD
  • 52,522
  • 5
  • 70
  • 86
  • Wonderful! I use dropDMG to generate the dmg, and it does support insert tiff as the background. So I generate the tiff, change its name to png, and output the dmg, AND IT WORKS! Don't know if dropDMG will update to support tiff as background. – Xiao Xiao Jun 26 '12 at 10:24
  • 1
    DropDMG 3.2 adds support for TIFF files as background images. You can also give it any type of graphic file, and it will generate a multi-resolution TIFF (with the text rendered optimally for each resolution). http://c-command.com/dropdmg/ – Michael Tsai Nov 07 '12 at 20:41
  • 2
    Just made a DMG background image using multi-page TIFF and it worked splendidly. We used the tiffutil command described on https://developer.apple.com/library/mac/#documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Optimizing/Optimizing.html#//apple_ref/doc/uid/TP40012302-CH7-SW13 – Chris R May 16 '13 at 20:38
  • 13
    Electron docs link here. This is the command you are looking for `tiffutil -cathidpicheck background.png background@2x.png -out background.tiff` – fionbio Mar 19 '18 at 20:01
  • @fionbio What resolution should the png file be when using your suggested `tiffutil` command? – Nyxynyx Aug 07 '19 at 17:47
  • 1
    @Nyxynyx This was a while ago, but I believe whatever you want. When working with Electron, I had set the window size to match the background size so the experience fits. – fionbio Aug 08 '19 at 07:48
  • @fionbio – follow the link in the answer and scroll up the page a bit to *Run the TIFF Utility Command in Terminal*, it talks about the relative sizes of the images. Note: the sizes are in *pixels* and do not include a "resolution". – CRD Aug 08 '19 at 16:09
3

TIFF files with 2 representations work as folder background images for Retina as expected. Mac OS X 10.5, 10.7 and 10.8 show a correct BG representation depending on whether HiDPI is available or not. Unfortunately 10.6 shows oversized high resolution representation instead of a normal one, which makes it unacceptable if you're targeting 10.6 as well.

pointum
  • 2,987
  • 24
  • 31