Can I convert svg to png?

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
exx8

Can I convert svg to png?

Post by exx8 »

Can I convert svg to png with imagick?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Can I convert svg to png?

Post by magick »

Yes.
exx8

Re: Can I convert svg to png?

Post by exx8 »

How can I?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Can I convert svg to png?

Post by magick »

We can't write code for you. For the conversion to work you simply read image.svg and write image.png. Its about 5 lines of code.
exx8

Re: Can I convert svg to png?

Post by exx8 »

magick wrote:We can't write code for you. For the conversion to work you simply read image.svg and write image.png. Its about 5 lines of code.
I know php, just I don't know this libary well :?
Can you tell me which function load svg image?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Can I convert svg to png?

Post by magick »

Have you read http://php.net/imagick? Use Imagick::readImage().
exx8

Re: Can I convert svg to png?

Post by exx8 »

magick wrote:Have you read http://php.net/imagick? Use Imagick::readImage().
http://www.php.net/manual/en/function.i ... dimage.php
There is no a lot of information there.
Which formats can I read with that function?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Can I convert svg to png?

Post by magick »

See http://www.imagemagick.org/script/formats.php for a list of image formats supported by ImageMagick.
Post Reply