Hello,
This question is a variation of a previously asked question that got no responses. I'm hoping somebody has some ideas.
I need to use the command line to rotate an svg image by one degree increments and resave the image so that I end up with 360 separate images all facing a compass degree. As a later step I'll need to export these images to png or gif.
I'll need to do this with quite a few images and it would be too tedious to do by hand, so I need to do this via command line.
From looking at the command line verbs, the only options I see that can help are:
-ObjectRotate90: Rotate selection 90° clockwise
-ToolSelector: Select and transform objects
-DialogTransform: Precisely control objects' transformations
The first option is obviously not going to give me 1 degree increments. Is it possible to use either of the other verbs to get 1 degree rotation from the command line?
Does anybody know any other programs that can help me rotate and svg and resave it via a batch process?
Thanks,
Ryan
Rotate image via command line
Re: Rotate image via command line
Hi Ryan,
Is the image changing in any other way except the 1 degree increment? Rotating the .png after the export with a third party software, ImageMagick comes to mind, is the way I'd try it.
Is the image changing in any other way except the 1 degree increment? Rotating the .png after the export with a third party software, ImageMagick comes to mind, is the way I'd try it.
Re: Rotate image via command line
Thanks for the suggestion.
We had considered ImageMagick as our backup solution (If used, we thought we might export the image in a rather huge size - for quality - and then have ImageMagick rotate it and reduce it).
We were hoping for a all-in-one way of having Inkscape rotate the image from the command line. It appears that is not possible.
For what it's worth, for anybody else attempting this, our next best solution (that seems to sort of work) is to take the SVG file and write a program that uses that code but adds a group transform to it like the following and then saves it:
<g transform="rotate(17.5,18,15)">
...
original SVG paths, etc.
...
</g>
By having our program do this for every compass direction we need, we can then use the Inkscape command line on each of these SVG files and export them to png.
Not the prettiest solution, but it is an automated way to achieve rotated images while keeping the quality and avoid using another program to help with the rotation.
Thanks,
Ryan
We had considered ImageMagick as our backup solution (If used, we thought we might export the image in a rather huge size - for quality - and then have ImageMagick rotate it and reduce it).
We were hoping for a all-in-one way of having Inkscape rotate the image from the command line. It appears that is not possible.
For what it's worth, for anybody else attempting this, our next best solution (that seems to sort of work) is to take the SVG file and write a program that uses that code but adds a group transform to it like the following and then saves it:
<g transform="rotate(17.5,18,15)">
...
original SVG paths, etc.
...
</g>
By having our program do this for every compass direction we need, we can then use the Inkscape command line on each of these SVG files and export them to png.
Not the prettiest solution, but it is an automated way to achieve rotated images while keeping the quality and avoid using another program to help with the rotation.
Thanks,
Ryan