如何为图像设置 Alpha 通道颜色?
Posted
技术标签:
【中文标题】如何为图像设置 Alpha 通道颜色?【英文标题】:How to set alpha channel color for image? 【发布时间】:2021-11-05 00:35:11 【问题描述】:我使用的旧软件无法读取某些 gif 格式。我有一张该软件可以完美读取的图像。这是此图像的magick identify
输出的一部分:
Image:
Filename: af4a4cd07bf8bf2e0a32ac795e3f688313992199.gif
Format: GIF (CompuServe graphics interchange format)
Mime type: image/gif
Class: PseudoClass
Geometry: 600x225+0+0
Units: Undefined
Colorspace: sRGB
Type: PaletteAlpha
Base type: Undefined
Endianness: Undefined
Depth: 8-bit
Channel depth:
Red: 8-bit
Green: 8-bit
Blue: 8-bit
Alpha: 1-bit
Channel statistics:
Pixels: 135000
Red:
min: 0 (0)
max: 255 (1)
mean: 210.766 (0.826532)
median: 255 (1)
standard deviation: 79.6865 (0.312496)
kurtosis: 0.391611
skewness: -1.42784
entropy: 0.34599
Green:
min: 0 (0)
max: 255 (1)
mean: 202.466 (0.793984)
median: 255 (1)
standard deviation: 88.9531 (0.348836)
kurtosis: -0.234975
skewness: -1.25805
entropy: 0.353168
Blue:
min: 0 (0)
max: 255 (1)
mean: 192.395 (0.75449)
median: 255 (1)
standard deviation: 99.826 (0.391474)
kurtosis: -0.681473
skewness: -1.07706
entropy: 0.353545
Alpha:
min: 0 (0)
max: 255 (1)
mean: 76.857 (0.3014)
median: 0 (0)
standard deviation: 117.011 (0.458868)
kurtosis: -1.25074
skewness: 0.865602
entropy: 0.882996
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 170.621 (0.669101)
median: 191.25 (0.75)
standard deviation: 96.3692 (0.377918)
kurtosis: -1.44093
skewness: -0.663742
entropy: 0.483925
Alpha: srgba(255,255,255,0) #FFFFFF00
Colors: 256
Histogram:
3519: (0,0,0,255) #000000FF black
67: (2,2,2,255) #020202FF srgba(2,2,2,1)
3: (2,2,6,255) #020206FF srgba(2,2,6,1)
1: (2,6,6,255) #020606FF srgba(2,6,6,1)
66: (4,85,5,255) #045505FF srgba(4,85,5,1)
85: (4,117,5,255) #047505FF srgba(4,117,5,1)
180: (5,150,5,255) #059605FF srgba(5,150,5,1)
20: (6,2,6,255) #060206FF srgba(6,2,6,1)
3: (6,4,12,255) #06040CFF srgba(6,4,12,1)
13: (6,7,2,255) #060702FF srgba(6,7,2,1)
32: (7,2,2,255) #070202FF srgba(7,2,2,1)
81: (7,6,6,255) #070606FF srgba(7,6,6,1)
39: (8,61,8,255) #083D08FF srgba(8,61,8,1)
6: (9,11,14,255) #090B0EFF srgba(9,11,14,1)
21: (9,38,5,255) #092605FF srgba(9,38,5,1)
2: (12,6,12,255) #0C060CFF srgba(12,6,12,1)
105: (12,12,11,255) #0C0C0BFF srgba(12,12,11,1)
68: (13,5,2,255) #0D0502FF srgba(13,5,2,1)
28: (13,16,18,255) #0D1012FF srgba(13,16,18,1)
119: (18,12,7,255) #120C07FF srgba(18,12,7,1)
105: (21,18,15,255) #15120FFF srgba(21,18,15,1)
58: (22,22,22,255) #161616FF srgba(22,22,22,1)
201: (26,8,2,255) #1A0802FF srgba(26,8,2,1)
156: (28,23,19,255) #1C1713FF srgba(28,23,19,1)
18: (28,86,29,255) #1C561DFF srgba(28,86,29,1)
265: (29,17,7,255) #1D1107FF srgba(29,17,7,1)
69: (29,28,28,255) #1D1C1CFF srgba(29,28,28,1)
63: (32,34,34,255) #202222FF srgba(32,34,34,1)
207: (36,13,2,255) #240D02FF srgba(36,13,2,1)
199: (36,19,5,255) #241305FF srgba(36,19,5,1)
118: (36,22,11,255) #24160BFF srgba(36,22,11,1)
109: (36,27,16,255) #241B10FF srgba(36,27,16,1)
125: (36,28,24,255) #241C18FF srgba(36,28,24,1)
145: (42,22,10,255) #2A160AFF srgba(42,22,10,1)
38: (42,31,35,255) #2A1F23FF srgba(42,31,35,1)
123: (42,40,38,255) #2A2826FF srgba(42,40,38,1)
76: (43,29,20,255) #2B1D14FF srgba(43,29,20,1)
142: (43,35,27,255) #2B231BFF srgba(43,35,27,1)
196: (44,20,3,255) #2C1403FF srgba(44,20,3,1)
100: (45,26,6,255) #2D1A06FF srgba(45,26,6,1)
108: (45,26,11,255) #2D1A0BFF srgba(45,26,11,1)
22: (48,14,2,255) #300E02FF srgba(48,14,2,1)
9: (48,22,13,255) #30160DFF srgba(48,22,13,1)
69: (48,35,21,255) #302315FF srgba(48,35,21,1)
82: (48,45,45,255) #302D2DFF srgba(48,45,45,1)
54: (49,30,15,255) #311E0FFF srgba(49,30,15,1)
50: (50,26,10,255) #321A0AFF srgba(50,26,10,1)
61: (50,30,10,255) #321E0AFF srgba(50,30,10,1)
66: (50,50,50,255) #323232FF srgba(50,50,50,1)
121: (51,21,2,255) #331502FF srgba(51,21,2,1)
210: (52,26,5,255) #341A05FF srgba(52,26,5,1)
125: (53,40,29,255) #35281DFF srgba(53,40,29,1)
20: (53,40,55,255) #352837FF srgba(53,40,55,1)
208: (53,44,37,255) #352C25FF srgba(53,44,37,1)
7: (53,108,53,255) #356C35FF srgba(53,108,53,1)
3: (54,26,10,255) #361A0AFF srgba(54,26,10,1)
4862: (54,29,8,255) #361D08FF srgba(54,29,8,1)
144: (54,30,10,255) #361E0AFF srgba(54,30,10,1)
15: (56,29,20,255) #381D14FF srgba(56,29,20,1)
88: (56,37,21,255) #382515FF srgba(56,37,21,1)
111: (57,56,54,255) #393836FF srgba(57,56,54,1)
3: (58,22,10,255) #3A160AFF srgba(58,22,10,1)
4: (58,26,11,255) #3A1A0BFF srgba(58,26,11,1)
257: (58,30,6,255) #3A1E06FF srgba(58,30,6,1)
146: (58,30,10,255) #3A1E0AFF srgba(58,30,10,1)
157: (59,50,44,255) #3B322CFF srgba(59,50,44,1)
67: (60,24,2,255) #3C1802FF srgba(60,24,2,1)
145: (60,34,11,255) #3C220BFF srgba(60,34,11,1)
77: (61,49,31,255) #3D311FFF srgba(61,49,31,1)
30: (63,30,5,255) #3F1E05FF srgba(63,30,5,1)
69: (63,58,63,255) #3F3A3FFF srgba(63,58,63,1)
68: (64,48,39,255) #403027FF srgba(64,48,39,1)
8: (65,26,13,255) #411A0DFF srgba(65,26,13,1)
59: (65,40,19,255) #412813FF srgba(65,40,19,1)
26: (66,33,15,255) #42210FFF srgba(66,33,15,1)
82: (67,44,26,255) #432C1AFF srgba(67,44,26,1)
37: (67,48,56,255) #433038FF srgba(67,48,56,1)
93: (67,67,67,255) #434343FF srgba(67,67,67,1)
159: (68,37,12,255) #44250CFF srgba(68,37,12,1)
121: (68,55,45,255) #44372DFF srgba(68,55,45,1)
53: (69,34,5,255) #452205FF srgba(69,34,5,1)
91: (69,54,35,255) #453623FF srgba(69,54,35,1)
73: (70,29,2,255) #461D02FF srgba(70,29,2,1)
115: (70,60,53,255) #463C35FF srgba(70,60,53,1)
77: (74,66,61,255) #4A423DFF srgba(74,66,61,1)
98: (74,72,70,255) #4A4846FF srgba(74,72,70,1)
71: (75,37,12,255) #4B250CFF srgba(75,37,12,1)
58: (75,47,25,255) #4B2F19FF srgba(75,47,25,1)
140: (76,42,14,255) #4C2A0EFF srgba(76,42,14,1)
99: (76,63,41,255) #4C3F29FF srgba(76,63,41,1)
115: (78,35,3,255) #4E2303FF srgba(78,35,3,1)
120: (79,65,53,255) #4F4135FF srgba(79,65,53,1)
93: (79,77,77,255) #4F4D4DFF srgba(79,77,77,1)
51: (80,53,32,255) #503520FF srgba(80,53,32,1)
45: (81,46,18,255) #512E12FF srgba(81,46,18,1)
52: (81,59,75,255) #513B4BFF srgba(81,59,75,1)
63: (82,83,82,255) #525352FF srgba(82,83,82,1)
99: (83,42,12,255) #532A0CFF srgba(83,42,12,1)
12: (83,55,22,255) #533716FF srgba(83,55,22,1)
6: (84,37,16,255) #542510FF srgba(84,37,16,1)
21: (84,50,23,255) #543217FF srgba(84,50,23,1)
146: (85,46,14,255) #552E0EFF srgba(85,46,14,1)
36: (85,60,37,255) #553C25FF srgba(85,60,37,1)
80: (85,70,44,255) #55462CFF srgba(85,70,44,1)
131: (85,72,60,255) #55483CFF srgba(85,72,60,1)
114: (86,39,4,255) #562704FF srgba(86,39,4,1)
511: (86,46,18,255) #562E12FF srgba(86,46,18,1)
163: (86,50,18,255) #563212FF srgba(86,50,18,1)
30: (86,55,30,255) #56371EFF srgba(86,55,30,1)
55: (86,73,68,255) #564944FF srgba(86,73,68,1)
48: (87,64,85,255) #574055FF srgba(87,64,85,1)
8: (89,42,18,255) #592A12FF srgba(89,42,18,1)
53: (89,82,76,255) #59524CFF srgba(89,82,76,1)
97: (89,88,87,255) #595857FF srgba(89,88,87,1)
128: (90,46,14,255) #5A2E0EFF srgba(90,46,14,1)
9: (90,121,90,255) #5A795AFF srgba(90,121,90,1)
260: (91,50,18,255) #5B3212FF srgba(91,50,18,1)
11: (91,54,25,255) #5B3619FF srgba(91,54,25,1)
22: (92,60,28,255) #5C3C1CFF srgba(92,60,28,1)
70: (92,76,47,255) #5C4C2FFF srgba(92,76,47,1)
99: (93,79,66,255) #5D4F42FF srgba(93,79,66,1)
125: (94,50,14,255) #5E320EFF srgba(94,50,14,1)
32: (94,54,19,255) #5E3613FF srgba(94,54,19,1)
111: (95,94,93,255) #5F5E5DFF srgba(95,94,93,1)
121: (96,44,4,255) #602C04FF srgba(96,44,4,1)
36: (96,64,36,255) #604024FF srgba(96,64,36,1)
970: (97,82,69,255) #615245FF srgba(97,82,69,1)
127: (98,82,70,255) #625246FF srgba(98,82,70,1)
79: (98,83,51,255) #625333FF srgba(98,83,51,1)
156: (98,86,70,255) #625646FF srgba(98,86,70,1)
20: (99,62,29,255) #633E1DFF srgba(99,62,29,1)
59: (99,72,94,255) #63485EFF srgba(99,72,94,1)
36: (100,84,60,255) #64543CFF srgba(100,84,60,1)
52: (100,92,84,255) #645C54FF srgba(100,92,84,1)
124: (101,54,16,255) #653610FF srgba(101,54,16,1)
7: (101,58,21,255) #653A15FF srgba(101,58,21,1)
8: (102,82,68,255) #665244FF srgba(102,82,68,1)
95: (102,86,70,255) #665646FF srgba(102,86,70,1)
97: (102,86,74,255) #66564AFF srgba(102,86,74,1)
97: (102,100,99,255) #666463FF srgba(102,100,99,1)
33: (103,68,38,255) #674426FF srgba(103,68,38,1)
109: (104,49,7,255) #683107FF srgba(104,49,7,1)
10: (105,58,23,255) #693A17FF srgba(105,58,23,1)
24: (105,74,50,255) #694A32FF srgba(105,74,50,1)
28: (106,54,18,255) #6A3612FF srgba(106,54,18,1)
33: (106,58,18,255) #6A3A12FF srgba(106,58,18,1)
89: (106,89,54,255) #6A5936FF srgba(106,89,54,1)
13: (107,86,75,255) #6B564BFF srgba(107,86,75,1)
84: (107,91,75,255) #6B5B4BFF srgba(107,91,75,1)
131: (108,54,11,255) #6C360BFF srgba(108,54,11,1)
6348: (108,57,16,255) #6C3910FF srgba(108,57,16,1)
27: (108,67,33,255) #6C4321FF srgba(108,67,33,1)
56: (108,95,60,255) #6C5F3CFF srgba(108,95,60,1)
15: (109,62,24,255) #6D3E18FF srgba(109,62,24,1)
3: (110,57,22,255) #6E3916FF srgba(110,57,22,1)
563: (110,58,18,255) #6E3A12FF srgba(110,58,18,1)
40: (110,62,18,255) #6E3E12FF srgba(110,62,18,1)
82: (110,80,107,255) #6E506BFF srgba(110,80,107,1)
56: (113,74,39,255) #714A27FF srgba(113,74,39,1)
87: (113,110,110,255) #716E6EFF srgba(113,110,110,1)
258: (114,58,14,255) #723A0EFF srgba(114,58,14,1)
51: (114,58,18,255) #723A12FF srgba(114,58,18,1)
513: (114,62,18,255) #723E12FF srgba(114,62,18,1)
13: (115,86,62,255) #73563EFF srgba(115,86,62,1)
74: (115,105,90,255) #73695AFF srgba(115,105,90,1)
12: (116,62,23,255) #743E17FF srgba(116,62,23,1)
110: (117,99,59,255) #75633BFF srgba(117,99,59,1)
68: (117,101,72,255) #756548FF srgba(117,101,72,1)
143: (118,62,18,255) #763E12FF srgba(118,62,18,1)
18: (118,67,25,255) #764319FF srgba(118,67,25,1)
54: (120,80,44,255) #78502CFF srgba(120,80,44,1)
83: (124,92,122,255) #7C5C7AFF srgba(124,92,122,1)
37: (125,66,19,255) #7D4213FF srgba(125,66,19,1)
148: (125,106,65,255) #7D6A41FF srgba(125,106,65,1)
108: (125,125,125,255) #7D7D7DFF grey49
59: (129,54,4,255) #813604FF srgba(129,54,4,1)
86: (131,89,51,255) #835933FF srgba(131,89,51,1)
78: (131,117,92,255) #83755CFF srgba(131,117,92,1)
181: (133,114,69,255) #857245FF srgba(133,114,69,1)
11: (136,76,29,255) #884C1DFF srgba(136,76,29,1)
99: (140,102,138,255) #8C668AFF srgba(140,102,138,1)
172: (142,122,74,255) #8E7A4AFF srgba(142,122,74,1)
62: (144,63,5,255) #903F05FF srgba(144,63,5,1)
79: (145,146,148,255) #919294FF srgba(145,146,148,1)
57: (146,132,104,255) #928468FF srgba(146,132,104,1)
194: (152,131,79,255) #98834FFF srgba(152,131,79,1)
64: (161,69,3,255) #A14503FF srgba(161,69,3,1)
187: (161,139,84,255) #A18B54FF srgba(161,139,84,1)
54: (163,163,166,255) #A3A3A6FF srgba(163,163,166,1)
152: (165,121,163,255) #A579A3FF srgba(165,121,163,1)
188: (171,147,87,255) #AB9357FF srgba(171,147,87,1)
126: (177,153,94,255) #B1995EFF srgba(177,153,94,1)
64: (182,183,186,255) #B6B7BAFF srgba(182,183,186,1)
65: (185,79,2,255) #B94F02FF srgba(185,79,2,1)
134: (185,159,91,255) #B99F5BFF srgba(185,159,91,1)
105: (189,164,99,255) #BDA463FF srgba(189,164,99,1)
4: (190,176,148,255) #BEB094FF srgba(190,176,148,1)
338: (196,143,189,255) #C48FBDFF srgba(196,143,189,1)
51: (197,171,93,255) #C5AB5DFF srgba(197,171,93,1)
109: (198,171,102,255) #C6AB66FF srgba(198,171,102,1)
63: (203,178,107,255) #CBB26BFF srgba(203,178,107,1)
80: (203,204,209,255) #CBCCD1FF srgba(203,204,209,1)
95: (207,177,103,255) #CFB167FF srgba(207,177,103,1)
144: (209,95,2,255) #D15F02FF srgba(209,95,2,1)
40: (210,189,114,255) #D2BD72FF srgba(210,189,114,1)
110: (212,183,106,255) #D4B76AFF srgba(212,183,106,1)
120: (219,188,110,255) #DBBC6EFF srgba(219,188,110,1)
59: (220,196,115,255) #DCC473FF srgba(220,196,115,1)
184: (222,163,214,255) #DEA3D6FF srgba(222,163,214,1)
68: (226,192,115,255) #E2C073FF srgba(226,192,115,1)
59: (228,199,111,255) #E4C76FFF srgba(228,199,111,1)
59: (230,208,123,255) #E6D07BFF srgba(230,208,123,1)
88: (230,230,234,255) #E6E6EAFF srgba(230,230,234,1)
130: (232,200,119,255) #E8C877FF srgba(232,200,119,1)
7: (235,223,135,255) #EBDF87FF srgba(235,223,135,1)
30: (237,216,127,255) #EDD87FFF srgba(237,216,127,1)
59: (238,206,117,255) #EECE75FF srgba(238,206,117,1)
87: (240,205,123,255) #F0CD7BFF srgba(240,205,123,1)
71: (243,211,125,255) #F3D37DFF srgba(243,211,125,1)
29: (245,214,130,255) #F5D682FF srgba(245,214,130,1)
34: (245,219,125,255) #F5DB7DFF srgba(245,219,125,1)
31: (245,220,131,255) #F5DC83FF srgba(245,220,131,1)
44: (246,207,122,255) #F6CF7AFF srgba(246,207,122,1)
2: (246,222,138,255) #F6DE8AFF srgba(246,222,138,1)
9: (246,228,133,255) #F6E485FF srgba(246,228,133,1)
1: (246,238,142,255) #F6EE8EFF srgba(246,238,142,1)
22: (247,213,121,255) #F7D579FF srgba(247,213,121,1)
33: (248,214,126,255) #F8D67EFF srgba(248,214,126,1)
13: (249,229,138,255) #F9E58AFF srgba(249,229,138,1)
42: (250,210,126,255) #FAD27EFF srgba(250,210,126,1)
50: (250,218,130,255) #FADA82FF srgba(250,218,130,1)
1: (250,218,134,255) #FADA86FF srgba(250,218,134,1)
22: (250,222,134,255) #FADE86FF srgba(250,222,134,1)
21: (250,223,130,255) #FADF82FF srgba(250,223,130,1)
2: (252,212,118,255) #FCD476FF srgba(252,212,118,1)
36: (253,219,126,255) #FDDB7EFF srgba(253,219,126,1)
32: (253,234,134,255) #FDEA86FF srgba(253,234,134,1)
144: (254,210,126,255) #FED27EFF srgba(254,210,126,1)
3062: (254,213,127,255) #FED57FFF srgba(254,213,127,1)
15: (254,214,126,255) #FED67EFF srgba(254,214,126,1)
90: (254,214,130,255) #FED682FF srgba(254,214,130,1)
8: (254,217,122,255) #FED97AFF srgba(254,217,122,1)
504: (254,218,130,255) #FEDA82FF srgba(254,218,130,1)
5: (254,218,134,255) #FEDA86FF srgba(254,218,134,1)
1: (254,220,140,255) #FEDC8CFF srgba(254,220,140,1)
346: (254,222,130,255) #FEDE82FF srgba(254,222,130,1)
196: (254,222,134,255) #FEDE86FF srgba(254,222,134,1)
10: (254,226,126,255) #FEE27EFF srgba(254,226,126,1)
375: (254,227,134,255) #FEE386FF srgba(254,227,134,1)
218: (254,229,138,255) #FEE58AFF srgba(254,229,138,1)
149: (254,235,140,255) #FEEB8CFF srgba(254,235,140,1)
36: (254,242,141,255) #FEF28DFF srgba(254,242,141,1)
27: (254,242,146,255) #FEF292FF srgba(254,242,146,1)
20: (254,249,149,255) #FEF995FF srgba(254,249,149,1)
277: (254,254,255,255) #FEFEFFFF srgba(254,254,255,1)
94311: (255,255,255,0) #FFFFFF00 srgba(255,255,255,0)
Colormap entries: 256
Colormap:
0: (0,0,0,1) #000000FF black
1: (254,213,127,1) #FED57FFF srgba(254,213,127,1)
...
还有这个软件无法读取的GIF:
Image:
Filename: test.gif
Format: GIF (CompuServe graphics interchange format)
Mime type: image/gif
Class: PseudoClass
Geometry: 942x807+0+0
Units: Undefined
Colorspace: sRGB
Type: PaletteAlpha
Base type: Undefined
Endianness: Undefined
Depth: 8-bit
Channel depth:
Red: 8-bit
Green: 8-bit
Blue: 8-bit
Alpha: 1-bit
Channel statistics:
Pixels: 760194
Red:
min: 0 (0)
max: 191 (0.74902)
mean: 114.081 (0.447376)
median: 0 (0)
standard deviation: 70.4866 (0.276418)
kurtosis: -0.990858
skewness: -0.768517
entropy: 0.483082
Green:
min: 0 (0)
max: 255 (1)
mean: 125.103 (0.4906)
median: 0 (0)
standard deviation: 85.1152 (0.333785)
kurtosis: -0.88958
skewness: -0.173986
entropy: 0.475376
Blue:
min: 0 (0)
max: 255 (1)
mean: 125.103 (0.4906)
median: 0 (0)
standard deviation: 85.1152 (0.333785)
kurtosis: -0.88958
skewness: -0.173986
entropy: 0.475376
Alpha:
min: 0 (0)
max: 255 (1)
mean: 191.036 (0.749163)
median: 0 (0)
standard deviation: 110.541 (0.433495)
kurtosis: -0.678534
skewness: -1.14955
entropy: 0.812602
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 138.831 (0.544435)
median: 0 (0)
standard deviation: 87.8146 (0.344371)
kurtosis: -1.16615
skewness: -0.29028
entropy: 0.561609
Alpha: none #00000000
Colors: 60
Histogram:
190685: (0,0,0,0) #00000000 none
730: (53,53,53,255) #353535FF srgba(53,53,53,1)
984: (59,59,59,255) #3B3B3BFF grey23
580: (67,67,67,255) #434343FF srgba(67,67,67,1)
388: (75,75,75,255) #4B4B4BFF srgba(75,75,75,1)
627: (83,83,83,255) #535353FF srgba(83,83,83,1)
18672: (93,93,93,255) #5D5D5DFF srgba(93,93,93,1)
32777: (99,99,99,255) #636363FF grey39
14: (103,105,105,255) #676969FF srgba(103,105,105,1)
18209: (108,108,108,255) #6C6C6CFF srgba(108,108,108,1)
393: (109,114,114,255) #6D7272FF srgba(109,114,114,1)
15818: (115,115,115,255) #737373FF grey45
19: (116,124,124,255) #747C7CFF srgba(116,124,124,1)
13: (118,131,131,255) #768383FF srgba(118,131,131,1)
15726: (123,123,123,255) #7B7B7BFF srgba(123,123,123,1)
15: (123,138,138,255) #7B8A8AFF srgba(123,138,138,1)
15: (124,131,131,255) #7C8383FF srgba(124,131,131,1)
2: (127,145,145,255) #7F9191FF srgba(127,145,145,1)
12469: (131,131,131,255) #838383FF srgba(131,131,131,1)
33: (132,140,140,255) #848C8CFF srgba(132,140,140,1)
11: (133,147,147,255) #859393FF srgba(133,147,147,1)
13: (133,154,154,255) #859A9AFF srgba(133,154,154,1)
13128: (140,140,140,255) #8C8C8CFF grey55
93: (140,146,146,255) #8C9292FF srgba(140,146,146,1)
7: (140,155,155,255) #8C9B9BFF srgba(140,155,155,1)
4: (140,163,163,255) #8CA3A3FF srgba(140,163,163,1)
6: (143,171,171,255) #8FABABFF srgba(143,171,171,1)
15740: (147,147,147,255) #939393FF srgba(147,147,147,1)
29: (148,155,155,255) #949B9BFF srgba(148,155,155,1)
5: (148,178,178,255) #94B2B2FF srgba(148,178,178,1)
44: (149,170,170,255) #95AAAAFF srgba(149,170,170,1)
19: (150,162,162,255) #96A2A2FF srgba(150,162,162,1)
3: (151,187,187,255) #97BBBBFF srgba(151,187,187,1)
274521: (153,153,153,255) #999999FF grey60
10: (155,187,187,255) #9BBBBBFF srgba(155,187,187,1)
75: (156,164,164,255) #9CA4A4FF srgba(156,164,164,1)
30: (156,170,170,255) #9CAAAAFF srgba(156,170,170,1)
15: (156,179,179,255) #9CB3B3FF srgba(156,179,179,1)
7: (156,193,193,255) #9CC1C1FF srgba(156,193,193,1)
15: (161,173,173,255) #A1ADADFF srgba(161,173,173,1)
101: (163,181,181,255) #A3B5B5FF srgba(163,181,181,1)
6363: (164,164,164,255) #A4A4A4FF srgba(164,164,164,1)
34: (164,203,203,255) #A4CBCBFF srgba(164,203,203,1)
48: (165,189,189,255) #A5BDBDFF srgba(165,189,189,1)
28: (165,195,195,255) #A5C3C3FF srgba(165,195,195,1)
10: (166,212,212,255) #A6D4D4FF srgba(166,212,212,1)
12: (169,196,196,255) #A9C4C4FF srgba(169,196,196,1)
10850: (170,170,170,255) #AAAAAAFF srgba(170,170,170,1)
23: (172,204,204,255) #ACCCCCFF srgba(172,204,204,1)
28: (172,212,212,255) #ACD4D4FF srgba(172,212,212,1)
39: (172,218,218,255) #ACDADAFF srgba(172,218,218,1)
12: (174,225,225,255) #AEE1E1FF srgba(174,225,225,1)
30: (176,214,214,255) #B0D6D6FF srgba(176,214,214,1)
36: (178,220,220,255) #B2DCDCFF srgba(178,220,220,1)
76: (180,228,228,255) #B4E4E4FF srgba(180,228,228,1)
28: (181,234,234,255) #B5EAEAFF srgba(181,234,234,1)
41: (183,241,241,255) #B7F1F1FF srgba(183,241,241,1)
37: (184,237,237,255) #B8EDEDFF srgba(184,237,237,1)
62: (187,244,244,255) #BBF4F4FF srgba(187,244,244,1)
130392: (191,255,255,255) #BFFFFFFF srgba(191,255,255,1)
Colormap entries: 64
Colormap:
0: (0,0,0,0) #00000000 none
...
19: (132,140,140,1) #848C8CFF srgba(132,140,140,1)
20: (140,140,140,1) #8C8C8CFF grey55
21: (133,147,147,1) #859393FF srgba(133,147,147,1)
22: (140,146,146,1) #8C9292FF srgba(140,146,146,1)
23: (133,154,154,1) #859A9AFF srgba(133,154,154,1)
24: (140,155,155,1) #8C9B9BFF srgba(140,155,155,1)
25: (147,147,147,1) #939393FF srgba(147,147,147,1)
26: (148,155,155,1) #949B9BFF srgba(148,155,155,1)
27: (153,153,153,1) #999999FF grey60
28: (140,163,163,1) #8CA3A3FF srgba(140,163,163,1)
...
我认为无法读取第二张图片,因为:
它有Alpha: none #00000000
(第一张图片有 Alpha: srgba(255,255,255,0) #FFFFFF00
);
它在颜色图中有 greyX
条目;
那么,如何将 Alpha 设置为 srgba
而不是 none
以及如何将颜色图中的 grayX
条目替换为 srgba
?
【问题讨论】:
【参考方案1】:您应该能够通过设置背景颜色然后将 alpha 设置为背景来设置 alpha...尽管如果我们通过 Dropbox 或 Google Drive 获取您的图像会有所帮助。
magick unhappy.gif -background 'srgba(255,255,255,0)' -alpha background happy.gif
【讨论】:
仍然有 alpha:无。这是一张图片:yadi.sk/d/UeQgMuDo29tgsg(它是 PNG,我正在尝试将其转换为 GIF) 也许可以试试magick unhappy.gif -alpha set ...
以上是关于如何为图像设置 Alpha 通道颜色?的主要内容,如果未能解决你的问题,请参考以下文章
XNA Texture2D.FromStream以1为单位暂时返回颜色通道