- for (cci=canoncolourinfos; cci->c; cci++) { \
- if (cci->rgb == rgb) { \
- (im)->d[y*(w) + x]= cci->c; \
- break; \
+ CANONIMG_ALSO_STORERGB((im)->rgb); \
+ if (rgb == last_rgb) { \
+ (im)->d[y*(w) + x]= last_c; \
+ } else { \
+ for (cci=canoncolourinfos; cci->c; cci++) { \
+ if (cci->rgb == rgb) { \
+ last_rgb= rgb; \
+ (im)->d[y*(w) + x]= last_c= cci->c; \
+ break; \
+ } \