function M = imread(imagepath)
    // This function reads any image type by using the unix command convert from ImageMagick.
    // Whatever the image type, the image is converted into the Matlab format .mat before being loaded in Scilab with the command loadmatfile.
    // 2014/10/03: v1 Bruno Galerne
    cmd = strcat(['convert ',imagepath, ' tttmmmpppiiimmmggg.mat']);
    unix_w(cmd);
    loadmatfile('tttmmmpppiiimmmggg.mat');
    unix_w('rm tttmmmpppiiimmmggg.mat');
endfunction


