I understand what you are doing, I am doing the same thing and adapting to this chance was annoying ...
You can set $ImageResolution = 72
at the beginning of the session.
Alternatively, you can make all rasterization explicit, and set ImageResolution -> 72
. This is some trouble because I also used to do things like Binarize@Graphics[Disk[],...]
instead of using Rasterize
explicitly.
I have not refactored all my code for this, but I was thinking of using something similar to the following:
rast[im_?ImageQ][gr_Graphics] :=
Module[{w, h},
{w, h} = ImageDimensions[im];
Rasterize[
Style[
Show[gr, PlotRange -> {{0, w}, {0, h}}, ImageSize -> {w, h}],
Antialiasing -> False
],
"Image",
ImageResolution -> 72
]
]
Then if we have an image image = RandomImage[{0.9, 1}, {100, 100}]
, we can rasterize corresponding masks as mask = rast[image][Graphics[Disk[{50, 50}, 50]]]
.
I am curious how others handle this.