How to resize swf image?

How to resize a vector image?

  • How do I resize a vector image with the command line? I'm trying to repeatedly resize a very simple vector image (eps, svg, pdf, whatever) on the OS X command-line with a script. The images will be resized at 50% to about 3000%. My immediate response was to use imagemagick, but it turns out that imagemagick doesn't preserve vector formats, but just wraps a vector format around a rasterized image. Does anybody have any suggestions? Thanks!

  • Answer:

    SVG images can have sizes defined: http://www.w3.org/TR/SVG/coords.html#UnitIdentifiers If your images have the height and width defined in the outer tag like this example, then maybe you can just modify it directly.

suedehead at Ask.Metafilter.Com Visit the source

Was this solution helpful to you?

Other answers

A vector image doesn't have a size. Its size is defined when it's rasterized for display or printing.

odinsdream

Vector graphics have a size. However they don't have a size of pixels but rather abstract coordinates. For processing SVG, it's a declarative XML format and you can use XSLT to do basic transforms (or perhaps regex if your input is amenable). EPS and PDF are procedural so resizing them won't make much sense.

pwnguin

Here's the http://old.nabble.com/Batch-resize-of-.svg-files.-td19674354.html asked on the Inkscape forum. I tried http://old.nabble.com/Re:-Batch-resize-of-.svg-files.-p19675496.html suggestion, and it worked with an Inkscape-created SVG. Note that you also need to edit the width and height attributes in the <svg> tag to change the canvas size. This is a few minutes of work in a scripting language to automate.

qxntpqbbbqxl

I've been using http://librsvg.sourceforge.net/ (it comes with a program called rsvg-convert) for some vector work I've been doing, and it has been very simple to use. I believe it does resizing.

!Jim

Yeah, I know vector images don't have a size -- the reason I need to 'resize' them is because I need each of them to be specifically, proportionately sized in relation to a raster image. A few hundred images, in fact. I'd like to automate that so that the rest of the process is painless importing in Indesign. It turns out that demiurge's method was the most convenient -- a simple 'sed' search-and-replace command was enough to let me modify and resize each SVG image. Thanks!

suedehead

Then you should mark it as a "best answer" to reward demiurge for taking the time to offer it to you.

Chocolate Pickle

Yes yes yes, just forgot to click the button.

suedehead

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.