Possible bug -remap IM 6.9.7.0 Q16 Mac OSX

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Possible bug -remap IM 6.9.7.0 Q16 Mac OSX

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Possible bug -remap IM 6.9.7.0 Q16 Mac OSX

Post 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?
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Possible bug -remap IM 6.9.7.0 Q16 Mac OSX

Post 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.
Post Reply