As a remedy, I suggest changing the ImageResolution
handling mechanism: do not translate ImageResolution
to ImageSizeRaw
, but set appropriate Magnification
instead:
Image[img, ImageResolution -> 72, Magnification -> 72/96]
Options@ToBoxes[%]

As you see from the screenshot, it allows avoiding the image size rounding and achieving pixel-perfect rendering of the image.