Colors Error
Posted: 2015-03-16T18:56:03-07:00
Image:
http://s3-us-west-2.amazonaws.com/qiniu-bs/bigger.png //clolormodel = palette 256
Command :
convert bigger.png -thumbnail 500x -colors 256 -type Palette a.png //fail
convert bigger.png -thumbnail 450x -colors 256 -type Palette a.png //success
debug info:
fail:
2015-03-16T18:09:00+08:00 0:00.120 0.170u 6.8.8 Coder convert[27782]: png.c/WriteOnePNGImage/8574/Coder
74 image->colors=256
75 2015-03-16T18:09:00+08:00 0:00.120 0.170u 6.8.8 Coder convert[27782]: png.c/WriteOnePNGImage/8582/Coder
76 Regenerate the colormap
77 2015-03-16T18:09:00+08:00 0:00.170 0.220u 6.8.8 Coder convert[27782]: png.c/WriteOnePNGImage/8699/Coder
78 Check colormap for background (65535,65535,65535)
79 2015-03-16T18:09:00+08:00 0:00.170 0.220u 6.8.8 Coder convert[27782]: png.c/WriteOnePNGImage/8719/Coder
80 background_color index is 256
81 2015-03-16T18:09:00+08:00 0:00.170 0.220u 6.8.8 Coder convert[27782]: png.c/WriteOnePNGImage/8734/Coder
82 image has more than 256 colors
83 2015-03-16T18:09:00+08:00 0:00.170 0.220u 6.8.8 Coder convert[27782]: png.c/WriteOnePNGImage/8935/Coder
84 image->colors=256
85 2015-03-16T18:09:00+08:00 0:00.170 0.220u 6.8.8 Coder convert[27782]: png.c/WriteOnePNGImage/8959/Coder
86 number_transparent = 0
87 2015-03-16T18:09:00+08:00 0:00.170 0.220u 6.8.8 Coder convert[27782]: png.c/WriteOnePNGImage/8973/Coder
88 number_opaque > 256
success:
9 2015-03-16T18:11:39+08:00 0:00.100 0.130u 6.8.8 Coder convert[27857]: png.c/WriteOnePNGImage/8719/Coder
80 background_color index is 253 //这开始取得值和索引值就与上面不同
81 2015-03-16T18:11:39+08:00 0:00.100 0.130u 6.8.8 Coder convert[27857]: png.c/WriteOnePNGImage/8738/Coder
82 image has 254 colors
83 2015-03-16T18:11:39+08:00 0:00.100 0.130u 6.8.8 Coder convert[27857]: png.c/WriteOnePNGImage/8815/Coder
84 Sort the new colormap
85 2015-03-16T18:11:39+08:00 0:00.100 0.130u 6.8.8 Coder convert[27857]: png.c/WriteOnePNGImage/8870/Coder
86 AcquireImageColormap
87 2015-03-16T18:11:39+08:00 0:00.100 0.140u 6.8.8 Coder convert[27857]: png.c/WriteOnePNGImage/8886/Coder
88 image->colors=254 (254)
89 2015-03-16T18:11:39+08:00 0:00.100 0.140u 6.8.8 Coder convert[27857]: png.c/WriteOnePNGImage/8890/Coder
90 Update the pixel indexes
91 2015-03-16T18:11:39+08:00 0:00.110 0.150u 6.8.8 Coder convert[27857]: png.c/WriteOnePNGImage/8935/Coder
92 image->colors=254
93 2015-03-16T18:11:39+08:00 0:00.110 0.150u 6.8.8 Coder convert[27857]: png.c/WriteOnePNGImage/8940/Coder
94 i (red,green,blue,opacity)
Now,can you tell me why this situation,and how to resolve it.
In my opinion ,colors's value should equal the colormodel's value when convert the image.
http://s3-us-west-2.amazonaws.com/qiniu-bs/bigger.png //clolormodel = palette 256
Command :
convert bigger.png -thumbnail 500x -colors 256 -type Palette a.png //fail
convert bigger.png -thumbnail 450x -colors 256 -type Palette a.png //success
debug info:
fail:
2015-03-16T18:09:00+08:00 0:00.120 0.170u 6.8.8 Coder convert[27782]: png.c/WriteOnePNGImage/8574/Coder
74 image->colors=256
75 2015-03-16T18:09:00+08:00 0:00.120 0.170u 6.8.8 Coder convert[27782]: png.c/WriteOnePNGImage/8582/Coder
76 Regenerate the colormap
77 2015-03-16T18:09:00+08:00 0:00.170 0.220u 6.8.8 Coder convert[27782]: png.c/WriteOnePNGImage/8699/Coder
78 Check colormap for background (65535,65535,65535)
79 2015-03-16T18:09:00+08:00 0:00.170 0.220u 6.8.8 Coder convert[27782]: png.c/WriteOnePNGImage/8719/Coder
80 background_color index is 256
81 2015-03-16T18:09:00+08:00 0:00.170 0.220u 6.8.8 Coder convert[27782]: png.c/WriteOnePNGImage/8734/Coder
82 image has more than 256 colors
83 2015-03-16T18:09:00+08:00 0:00.170 0.220u 6.8.8 Coder convert[27782]: png.c/WriteOnePNGImage/8935/Coder
84 image->colors=256
85 2015-03-16T18:09:00+08:00 0:00.170 0.220u 6.8.8 Coder convert[27782]: png.c/WriteOnePNGImage/8959/Coder
86 number_transparent = 0
87 2015-03-16T18:09:00+08:00 0:00.170 0.220u 6.8.8 Coder convert[27782]: png.c/WriteOnePNGImage/8973/Coder
88 number_opaque > 256
success:
9 2015-03-16T18:11:39+08:00 0:00.100 0.130u 6.8.8 Coder convert[27857]: png.c/WriteOnePNGImage/8719/Coder
80 background_color index is 253 //这开始取得值和索引值就与上面不同
81 2015-03-16T18:11:39+08:00 0:00.100 0.130u 6.8.8 Coder convert[27857]: png.c/WriteOnePNGImage/8738/Coder
82 image has 254 colors
83 2015-03-16T18:11:39+08:00 0:00.100 0.130u 6.8.8 Coder convert[27857]: png.c/WriteOnePNGImage/8815/Coder
84 Sort the new colormap
85 2015-03-16T18:11:39+08:00 0:00.100 0.130u 6.8.8 Coder convert[27857]: png.c/WriteOnePNGImage/8870/Coder
86 AcquireImageColormap
87 2015-03-16T18:11:39+08:00 0:00.100 0.140u 6.8.8 Coder convert[27857]: png.c/WriteOnePNGImage/8886/Coder
88 image->colors=254 (254)
89 2015-03-16T18:11:39+08:00 0:00.100 0.140u 6.8.8 Coder convert[27857]: png.c/WriteOnePNGImage/8890/Coder
90 Update the pixel indexes
91 2015-03-16T18:11:39+08:00 0:00.110 0.150u 6.8.8 Coder convert[27857]: png.c/WriteOnePNGImage/8935/Coder
92 image->colors=254
93 2015-03-16T18:11:39+08:00 0:00.110 0.150u 6.8.8 Coder convert[27857]: png.c/WriteOnePNGImage/8940/Coder
94 i (red,green,blue,opacity)
Now,can you tell me why this situation,and how to resolve it.
In my opinion ,colors's value should equal the colormodel's value when convert the image.