Convert SVG to PNG and then fit to square ?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
joris
Posts: 1
Joined: 2013-10-05T09:09:33-07:00
Authentication code: 6789

Convert SVG to PNG and then fit to square ?

Post by joris »

Hi,

I search to do the following :
- convert a .svg to a .png
- fit the png to square dimension without deforming the image

is it possible ?

I can convert like this :

Code: Select all

convert -density 500 -background white file.svg file.png
Now I want result png to fit square dimensions.

Thanks in advance for your help !

PS: I'm sorry for my english, I'm french ;)
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert SVG to PNG and then fit to square ?

Post by snibgo »

I don't know what you mean by "fit the png to square dimension without deforming the image".

This ...

Code: Select all

convert -density 500 -background white file.svg -resize 600x600 file.png
... will ensure that the image will fit within a 600x600 square. The maximum dimension of the result will be 600 pixels.
snibgo's IM pages: im.snibgo.com
Post Reply