This is a pseudo question to share my own trick and script below.
The point is to be able to display image pixel for pixel on Retina displays. This is mainly useful for high resolution image and/or for developers working on HDPI version of images.
The solution works well only if the display setting is set to 2:1 ratio in the OS X preferences. Beware, late 2016 MacBook Pro default setting is not set to 2:1 by default. You should set it on the medium setting to get it right.
Finder : the simple trick is to give a name ending with
@2x
(before the extension):my_image@2x.jpg
. Then when using Quick Look feature the image is pixel-wise. As this naming scheme is recommended for retina images, both normal and HDPI images display at same size, as expected, the retina being sharper.Preview : In preview, the DPI resolution of an image is interpreted as normal if it is set to 72dpi. By setting it to 144, you get the right display ratio. One can achieve the same effect at 72dpi by changing the display scale to 50%, but the scale setting does not stick to the image file while the DPI setting does. Change it through the Tools->Size menu item.
Here below is a small applescript to automate 144dpi setting from the Finder.
Since the
sips
command does not preserve tags, the script includes 4 lines to get and set them back to the file after it has been modified, using thexattr
command.To install the script: open the script editor, create a new document, paste the code and save it into the ~/Library/Scripts/Finder folder. Be sure to check the
Show the Script Menu
option in Script editor preference.To use the script: select image file(s) in Finder and activate the script from the menu.