我遇到了一些编码SVG XML的真正的大问题,并让它在Illustrator中被复制,正如我期待的那样。现在的主要问题是feColorMatrix效应。我明白效果以及矩阵如何改变像素,但是我遇到的问题是,当我将0.5指定为任何颜色通道行的最终输出结果时,Illustrator不会将0.5解释为RGB 127,换句话说,50%颜色值。它更像是0.215等于127十进制的RGB。下面是一些代码:Illustrator SVG效果编码问题
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns="http://www.w3.org/2000/svg"
version="1.2"
viewBox="0 0 576 432"
width="576"
height="432"
baseProfile="tiny"
id="NicoleLovesSVG">
<g id="Canvas">
<rect
width="576"
height="432"
x="0"
y="0"
transform="scale(1,1)"
id="Canvas-Rect1"
style="fill:#9d8654;fill-rule:evenodd;" />
</g>
<defs>
<filter id="ShadowFilter-Text1" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse" width="200%" height="200%" x="-50%" y="-50%">
<feColorMatrix type="matrix" in="SourceAlpha"
values="0 0 0 0 .5
0 0 0 0 0
0 0 0 0 0
0 0 0 1 0"/>
<feOffset dx="24.395183950936" dy="24.395183950936" result="shadow"/>
<feBlend in="SourceGraphic" in2="shadow" mode="normal"/>
</filter>
</defs>
<g
id="Text1"
transform="translate(1.1272727272727,297.27272727273) rotate(0) scale(3.5238813920454546,2.642911044034091)"
style="fill:#003300;fill-opacity:1;fill-rule:evenodd;stroke:#ff0000;stroke-width:15px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;"
filter="url(#ShadowFilter-Text1)">
<g
id="Text1-Line1"
transform="translate(0,0)">
<path
transform="translate(0,0)"
vector-effect="non-scaling-stroke"
id="Text1-Line1-Glyph1"
d="M 0,0 M 46.4,-98.24 L 46.4,-15.68 C 46.4,-8.96 47.466666666667,-3.7333333333333 49.6,-0 L 30.4,-0 C 32.533333333333,-3.7333333333333 33.6,-8.96 33.6,-15.68 L 33.6,-98.24 L 31.36,-98.24 C 21.653333333333,-98.24 12.106666666667,-96.373333333333 2.72,-92.64 L 8.32,-106.72 L 79.68,-106.72 L 74.56,-92.64 C 68.693333333333,-96.48 59.306666666667,-98.346666666667 46.4,-98.24 z" />
</g>
</g>
</svg>
正如你所看到的,第一过滤检索SourceAlpha这是全黑的。然后,颜色矩阵采用的是和执行此矩阵的第一行:
(斧红色)+(BX绿色)+(CX蓝色)+(DX阿尔法)+ E =最终红色输出
堵塞在数字:
(0 X 0)+(0 X 0)+(0 X 0)+(0 X 0)+ 0.5 = 0.5
应为50%的红色!或127 RGB!我做了数学,在Illy它更像是0.215 = 127 = 50%??????
随机猜测:可能与预乘alpha有关? – Phrogz
我不这么认为。您可以使用“SourceGraphic”更改“SourceAlpha”并获得相同的结果。 – shrimpwagon