Key order in SVG-PNG converting
Posted: 2016-03-23T02:05:33-07:00
Hi!
I had two questions here
1) I've recenty read the guide for command-line arguments. Before it I've knew nothing about settings options and image operators and though all cmd keys are equal. So that I've remembered we had a prolem with converting from SVG to PNG with transparent background.
We realised that command
did not set background transparent, but reoder keys to
did the thing!
Can anybody, please, explain how does it work?
Also it's interesting to me: in man it's said that "-background" is an operator setting, so it should set the value to be used by the following operation. But where's the operation in my command?
And the second question:
2) It's also troubles with SVG to PNG converting. We has an image with a following code:
Actually writing have no effect on svg-image, but after converting it with IM it sets dashes equals to spaces with length 10. If writnig everything's doing fine. Is it a bug or a feature? However, that's not a qusetion.
I converted image with two commands on my Win7 machine:
and
Then I just compare them using command
and it gives the result "gray(0)" that means images are equal.
But after that I do the same on an Ubuntu 14.04 headless Docker container and it sais that the difference is equals to "gray(7)".
Why it behaves so and what's the matter here?
I'll be happy to hear any sujestions and ideas you have. Thank you!
I had two questions here
1) I've recenty read the guide for command-line arguments. Before it I've knew nothing about settings options and image operators and though all cmd keys are equal. So that I've remembered we had a prolem with converting from SVG to PNG with transparent background.
We realised that command
Code: Select all
convert in.svg -background transparent -depth 8 out.png
Code: Select all
convert -background transparent in.sg -depth 8 out.png
Can anybody, please, explain how does it work?
Also it's interesting to me: in man it's said that "-background" is an operator setting, so it should set the value to be used by the following operation. But where's the operation in my command?
And the second question:
2) It's also troubles with SVG to PNG converting. We has an image with a following code:
Code: Select all
<svg xmlns="http://www.w3.org/2000/svg" width="1440" height="200">
<rect x="0" y="20" width="1440" height="160" fill="rgba(222,222,222,0.5)"/>
<rect x="51" y="1" width="180" height="180" fill="tomato" stroke-width="2" stroke="gray" stroke-dasharray="10, 5" opacity="0.75" />
<circle cx="359" cy="91" r="90" stroke="gray" stroke-width="2" fill="lightblue" stroke-dasharray="10 5" opacity="0.75" />
<polygon points="160,199 250,43 340,199" fill="lightgreen" stroke="darkgray" stroke-width="4" opacity="0.75" />
</svg>
Code: Select all
stroke-dasharray="10 5"
Code: Select all
stroke-dasharray="10, 5"
I converted image with two commands on my Win7 machine:
Code: Select all
convert -background none plate.svg -resize 50% -depth 8 plate1.png
Code: Select all
convert -background none plate.svg -depth 8 -resize 50% plate2.png
Code: Select all
compare plate1.png plate2.png -compose Src -highlight-color White -lowlight-color Black :| convert - -resize 1x1\! -format '%[pixel:p{0,0}]' info:
But after that I do the same on an Ubuntu 14.04 headless Docker container and it sais that the difference is equals to "gray(7)".
Why it behaves so and what's the matter here?
I'll be happy to hear any sujestions and ideas you have. Thank you!