Remove["Global`*"];
Install["binary"];
<< Graphics`Graphics`;
<< 
        DiscreteMath`Combinatorica`;

SetDirectory[
        ToFileName[
          Extract["FileName" /. 
              NotebookInformation[EvaluationNotebook[]], {1}, 
            FrontEnd`FileName]]];

fileName = "Canal-mini.raw";
f = 
        FastBinaryFiles`ReadListBinary[fileName, 
          Byte];
nRow = 127;  nCol = 127;
f =  Partition[f, nCol];
Dimensions[f]
f = Take[f, {1, -2}, {1, -2}];
Dimensions[f]
nRow = 116; nCol = 
      126;

ListDensityPlot[Reverse[f], 
        Mesh -> False, Frame -> False, 
        ImageSize -> {nRow, nCol}, PlotRange -> All, 
        AspectRatio -> Automatic, 
        PlotLabel -> {fileName}];

\(\(\(\ \)\(
\)\(
\)\(
\)\(\ \)\)\)

centeredData = 
        Table[( -1)^(x + y) f[[x, 
              y]], {x, 1, nRow}, {y, 1, 
            nCol}];
 

    Dimensions[centeredData]
 

    g = 
        Chop[Fourier[centeredData , 
            FourierParameters -> {-1, -1}]];

    Dimensions[g]

g = 
        Abs[Take[g, {1, nRow}, {1, nCol}]];

    g = Round[Chop[g]];
 

    c = 3;

    g = Round[N[c Log[1 + g]]];

    Take[g, {1, 5}, {1, 5}] // MatrixForm

    m1 = Max[g]

    m2 = Min[g]

    delta = N[256/(m1 - m2 ) ]

    g2 = Round[g *delta];

    Dimensions[g2]

    Take[g2, {1, 6}, {1, 6}] // N

    ListDensityPlot[Reverse[g2], Mesh -> False, Frame -> False, 
        ImageSize -> {nRow, nCol}, PlotRange -> All, 
        AspectRatio -> Automatic, 
        PlotLabel -> {fileName}];

Take[g2, {1, 6}, {1, 6}] // N
Take[g2, {475, 480}, {635, 640}] // N

Take[g, {1, 4}, {1, 4}] // N

ListDensityPlot[Reverse[f], Mesh -> False, Frame -> False, 
        ImageSize -> {nRow, nCol}, PlotRange -> All, 
        AspectRatio -> Automatic, 
        PlotLabel -> {fileName}];

Take[
      N[g2], {1, 100}, {1, 
        100}]