# The Story Behind the MATLAB Default Image13

Posted by Steve Eddins,

Image display was added in version 4 of MATLAB, sometime around 1990. Many observant users noticed that the low-level image display object had default pixel values. In other words, if you called image with no input arguments, it would display a small image. If you were a MATLAB 4 user, you might have seen something like this:

When MATLAB 5 was released, some users noticed that the default image had changed.

image
colormap(gray(32))
axis ij

A few users also noticed that the pixel values in the new default image were not integers.

h = findobj(gcf,'type','image');
cdata = get(h,'CData');
cdata(1:3,1:3)
ans =

11.2307   12.4251   10.4251
14.4251   15.7483   13.7483
12.3938   13.7483   12.7483



Is there something interesting about the fractional part?

imagesc(cdata - floor(cdata))

Apparently so.

I now confess - you can blame me for all of this. I told this story in public for the first time last week at the IEEE International Conference on Image Processing in Atlanta, GA. Now, dear blog readers, you get to hear it, too.

I joined The MathWorks toward the end of 1993. Sometime in 1994, the company held its first employee charity auction. One of the "items" put up for bid was the right to choose the default image for MATLAB 5, which was then under development. As the new "image processing guy" in development, I felt some responsibility to bid. (At least, that's the way I tried to explain it later to my wife.) As it turned out, another MathWorks developer really wanted to win this item, so to win it I ended up paying big bucks. (It's all for charity, I kept reminding myself.)

Once I won the auction, I had to decide what image to pick. During this time, I frequently heard complaints from users that MATLAB could only handle double-precision values. (That lasted until 1997.) Because I heard so much about this issue, I decided that I would use all of the mantissa bits for the new default image. I solicited ideas from my fellow developers for what to include.

Here are the various images "hidden" in different bit slices of the default image pixel values. (To run the code yourself, download this little utility function, bitslice.)

The image stored in the 5 most-significant bits is the one you usually see. This is my oldest son.

defimage = pow2(get(0,'DefaultImageCData'),47);
mag = 200;
imshow(bitslice(defimage,47,51), 'initialmag', mag);

The next 5 bits show a dog that belonged to a MathWorks developer.

imshow(bitslice(defimage,42,46), 'initialmag', mag);

Here's another MathWorks pet.

imshow(bitslice(defimage,37,41), 'initialmag', mag);

This famous matrix is the inverse of the 3-by-3 Hilbert matrix.

imshow(bitslice(defimage,36,36), 'initialmag', mag);

This is a low-resolution version of the company's original logo.

imshow(bitslice(defimage,35,35), 'initialmag', mag);

Loren's favorite number.

imshow(bitslice(defimage,34,34), 'initialmag', mag);

3-by-3 magic square.

imshow(bitslice(defimage,33,33), 'initialmag', mag);

My youngest son.

imshow(bitslice(defimage,28,32), 'initialmag', mag);

A famous magic square hidden in Albrecht Durer's Melancolia.

imshow(bitslice(defimage,23,27), 'initialmag', mag);

I couldn't resist a kind of visual pun. This is the original MATLAB "eight-bit image." (That'll tell you something about my sense of humor.)

imshow(bitslice(defimage,18,22), 'initialmag', mag);

Loren at age 4.

imshow(bitslice(defimage,13,16), 'initialmag', mag);

Wilkinson, Givens, and Forsythe, from the 1964 Gatlinburg Conference on Numerical Algebra.

imshow(bitslice(defimage,9,12), 'initialmag', mag);

Me.

imshow(bitslice(defimage,5,8), 'initialmag', mag);

The original default image from MATLAB 4 is still in there.

imshow(bitslice(defimage,1,4), 'initialmag', mag);

Finally, a certain combination of three bit slices makes a yellow pig with the number 17 superimposed on it. I've been told this is some sort of secret joke within a certain mathematical community.

r = bitslice(defimage,0,0);
g = bitslice(defimage,17,17);
b = bitslice(defimage,34,34);
imshow(cat(3,r,g,b), 'initialmag', mag);

There you have it - the complete story of the MATLAB default image.

Get the MATLAB code

Published with MATLAB® 7.3

Kathirvel Thiyagarajan replied on : 1 of 13

Respected Steve,

Thanks for introducing us to loren blog pages.
Can you explain more technically about the bit slice image and how to create a image like the matlab default image which has more hidden images?

Vitor replied on : 2 of 13

Perfect, Steve! This (almost) non-technical subject is great.
Thanks.

Wes replied on : 3 of 13

Interesting. I’d always wondered what the story was with that ghostly image that I’ve seen from time to time when I passed image some bad parameters.

I’m also curious: what is the history of the cameraman image? Quick web searches don’t seem to turn up anything both relevant and informative.

Steve replied on : 4 of 13

Wes – the only thing I know about the cameraman image is that it is owned by MIT. We have permission from them to use it in examples and demos for our products.

Steve replied on : 5 of 13

Rick Spada replied on : 6 of 13

For what it’s worth, the other person that Steve bid against was me, and my dog’s name was Pepper. Fortunately, I had my wife next to me during the bidding, and had I won, there would have been a lot less explaining to do :-)

Rob replied on : 7 of 13

Steve,

Great stuff!

I’m glad you won – among other things, embedding all the layered info into the default image is a great instructional example. It also leads to thoughts of steganography… Is that in your area of interest?

Question: is there a graphic file format that would preserve the bit-depth that you used in the Matlab default image? I can’t think of anything off the bat since they all seem to use integers.

-Rob

Steve replied on : 8 of 13

Rob – Beyond skimming the occasional paper on the topic, I’ve never really looked seriously at steganography methods. There are a couple of submissions on the MATLAB Central File Exchange that you might want to look at.

I don’t know of a graphic file format that would hold everything. A few, like TIFF, can store 32-bit ints or floats, but that wouldn’t do it.

Farhad Aslani replied on : 9 of 13

Hi Steve!

It was very interesting. Thank you for all that.
But I beleive that the story is not complete yet ;)
image, and the default image you get there is complete different.
I hope there is an interesting story about that as well??

Steve replied on : 10 of 13

opcs replied on : 11 of 13

when i execute the codes in matlab
x=imread(‘pepper.tif’), it takes image from some directory and can display it using show command.

can u lightup, from which directory the image belongs to, i think it is bydefault images that is inbuilt in matlab, but where it has been stored ?

Steve replied on : 12 of 13

Opcs—Possibly you mean the image peppers.png? Try this:

>> which peppers.png
C:\Program Files\MATLAB\R2009b\toolbox\images\imdemos\peppers.png

Behamin B replied on : 13 of 13

These default images are a pest! seriously remove them!
I’ve been spending hours to remove this and i cant.. !

These postings are the author's and don't necessarily represent the opinions of MathWorks.