I have been trying to create an image from a file path but the resulting image consists of huge noise.
What I have done so far:-
function createImage($imag