Page 1 of 1

Possible bug -remap IM 6.9.7.0 Q16 Mac OSX

Posted: 2016-12-31T13:45:29-07:00
by fmw42
It seems that -remap is introducing a color not in my colormap image.

Input:
Image

ColorMap Image:

Code: Select all

convert xc:red xc:orange xc:yellow xc:lime xc:cyan xc:blue xc:magenta xc:white xc:black +append colormap.png
Image <--- 1D image (9x1)

Code: Select all

identify -verbose colormap.png
Colormap:
0: (255, 0, 0) #FF0000 red
1: (255,165, 0) #FFA500 orange
2: (255,255, 0) #FFFF00 yellow
3: ( 0,255, 0) #00FF00 lime
4: ( 0,255,255) #00FFFF cyan
5: ( 0, 0,255) #0000FF blue
6: (255, 0,255) #FF00FF magenta
7: (255,255,255) #FFFFFF white
8: ( 0, 0, 0) #000000 black


Processing with -remap:

Code: Select all

convert logo.png +dither -remap colormap.png logo_mapped.png

Code: Select all

identify -verbose logo_mapped.png
Colormap:
0: (255,255,255) #FFFFFF white
1: ( 0, 0, 0) #000000 black
2: (255,165, 0) #FFA500 orange
3: ( 0, 0,255) #0000FF blue
4: (255,255, 0) #FFFF00 yellow
5: (255, 0, 0) #FF0000 red
6: ( 4, 7, 7) #040707 srgb(4,7,7) <--- This color is not In my colormap.png

Re: Possible bug -remap IM 6.9.7.0 Q16 Mac OSX

Posted: 2016-12-31T14:20:12-07:00
by snibgo
I get the same result in v6.9.5-3, but I don't think it is a problem. The final "identify" shows:

Code: Select all

  Histogram:
     17738: (  0,  0,  0) #000000 black
     14104: (  0,  0,255) #0000FF blue
      3942: (255,  0,  0) #FF0000 red
      6487: (255,165,  0) #FFA500 orange
      2089: (255,255,  0) #FFFF00 yellow
    262840: (255,255,255) #FFFFFF white

  Colormap entries: 7
  Colormap:
         0: (255,255,255) #FFFFFF white
         1: (255,255,  0) #FFFF00 yellow
         2: (255,165,  0) #FFA500 orange
         3: (  0,  0,  0) #000000 black
         4: (255,  0,  0) #FF0000 red
         5: (  0,  0,255) #0000FF blue
         6: (  4,  7,  7) #040707 srgb(4,7,7)
The "histogram" shows that the only colours in the image are those from colormap.png.

The "colormap" is the palette, and we see that it contains an entry not used in the image. Is this a real problem?

Re: Possible bug -remap IM 6.9.7.0 Q16 Mac OSX

Posted: 2016-12-31T15:07:08-07:00
by fmw42
snibgo wrote:The "colormap" is the palette, and we see that it contains an entry not used in the image. Is this a real problem?
Not really a problem. I just wanted to know why that is there and if that is a bug in the sense that it should not even be listed, since that is confusing.