m-files
This version is written for images (such as billiken.gif) that use a color map. In this case, we can not determine the similarity between colors by the color indices, but rather must go into the color map to get the (r,g,b) values associated with two different indices.
This version is written for images (such as billiken.png) that provide full (r,g,b) color information in the image array.
Images
You may load this file in MATLAB using the command
[A map] = imread('billiken.gif');The array A is a 126-by-126 array of 8-bit integers that are indices into a colormap. map is a 256-by-3 array that provides the (r,g,b) values for the color indices. For example, map(k, :) is a vector of length three with the corresponding red, green, and blue values (between 0.0 and 1.0) for index k of the color map.
You may load this file in MATLAB using the command
A = imread('billiken.png');The returned array A is a three-dimensional array of size 202-by-320-by-3, where entry A(r,c,:) is a vector of length three with the corresponding red, green and blue values (integers from 0 to 255).