diff scripts/image/saveimage.m @ 6967:65a28e9de0a5

[project @ 2007-10-06 12:47:11 by jwe]
author jwe
date Sat, 06 Oct 2007 12:49:25 +0000
parents 673686daec87
children 93c65f2a5668
line wrap: on
line diff
--- a/scripts/image/saveimage.m	Sat Oct 06 05:46:30 2007 +0000
+++ b/scripts/image/saveimage.m	Sat Oct 06 12:49:25 2007 +0000
@@ -81,7 +81,11 @@
   endif
 
   if (nargin < 4)
-    map = colormap ();
+    if (size(img, 3) == 3)
+      [img, map] = rgb2ind(img);
+    else
+      map = colormap ();
+    endif
   endif
 
   [map_nr, map_nc] = size (map);