Getting imgcat to show images at retina resolution
I'm trying to figure out how to make it so that images generated by dvipng render at retina resolution. Unfortunately, dvipng
locks the actual PNG resolution (the pHYs chunk) at 96 DPI. Increasing the DPI with the -D
flag simply results in a larger image (see https://tex.stackexchange.com/questions/110273/how-to-increase-the-dpi-without-increasing-the-size-of-the-picture-via-dvipng/110293#110293).
Unfortunately, whenever I create such an image and imgcat
it, iTerm2 shows it at pixelated size. If I open the image in Preview it is shown at the same size as iTerm2.
So I've tried remedying this by modifying the DPI of the PNG, hopefully scaling down the image so it is shown at a crisp resolution. I determined that if you set the DPI to anything higher than 144 (which is the native resolution if you take a screenshot), then Preview stops "zooming it out" and just shows it at the same larger, pixelated resolution. I guess I understand this because that means one image pixel would be less than one screen pixel at those DPIs, although I don't get why the default is the old style, non-retina size.
For iTerm2, the DPI seems to be ignored no matter what I set it to.
My goal is to show math equations inline in the terminal. But since it's text, the result looks really bad if the images are not retina resolution.
I think this issue is closely related to #6492.
Right now, I guess a workaround is to specify the width and height pixels exactly in the escape sequence, so that they are half of the real width and height. It would be nice if auto
just worked here, though, at least if the image DPI is 144 or higher.