The Examples section for the documentation of IMREAD, gives the following code:
bg = [255 0 0];A = imread('your_image.png','BackgroundColor',bg);
When I execute this example with my PNG image, I get the following error:
??? Error using ==> png Invalid background color specification. Error in ==> readpng at 58 [X,map] = png('read',filename, bg); Error in ==> imread at 430 [X, map] = feval(fmt_s.read, filename, extraArgs{:});
Best Answer