So, what was the source of the problem? Was is too rough default binning by ImageHistogram
(default is 128 bins)?
Apparently imported image contains no out-of range values:
ImageData[img] // MinMax
(* => {0., 1.} *)
But a naive attempt to obtain it directly from the "Data"
element by applying Rescale
to each color channel separately produces a slightly different image:
data = Import["DSC_2106.NEF", "Data"];
img = Import["DSC_2106.NEF"];
subimage = ImageTake[img, {-4500, -3000}, {1300, 2700}];
subimageFromData =
Image[Rescale /@ Transpose[N@data[[-4500 ;; -3000, 1300 ;; 2700]], {2, 3, 1}],
Interleaving -> False];
ImageData[subimageFromData] - ImageData[subimage] // MinMax
(* => {0., 0.0346075} *)