I = imread ("spritesheet.png"); for i = 1:rows(I) for j = 1:columns(I) if I(i,j,1) == 0 && I(i,j,2) == 136 && I(i,j,3) == 255 I(i,j,:) = 0; endif endfor endfor imwrite(I,"spritesheet_w_background.png");