added division in pixel conversion, which I forgot before.
in --tryimg changed function from invert to grayscale. code compiles.