473,796 Members | 2,425 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SVG->PNG image conversion

Hi all,

I don't have ImageMagick installed currently (and not sure if this has the
ability or not anyway yet), but I've done some googling and not come up
with much (if anything) regarding this.

I'm hoping to write a script that I can use to accept user input for x,y
coords for an image size. The image would initially be stored in SVG
format for quality and would like to then resize this according to the
users dimension specifications and produce a PNG image.

My server doesn't run X (for obvious reasons? =) ) and I don't _really_
want top have to bloat it out with gnomelibs and the likes to install
Sodipodi on it to do the conversions so was wondering if anyone knew of
anything available to help in the process.

I'm happy to work on the XML itself with PHP (althoguh I'd need to
research some on the topic).. but was kind of hoping someone knew of a
small binary that I could run via system() / exec() etc for simplicity.

Any info / suggestions / recommendations et al. greatly welcomed =)
TIA.

Regards,

Ian

--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.ne t | forum.digiserv. net
Programming, Web design, development & hosting.

Jul 17 '05 #1
6 27792

On 2003-12-20, Ian.H <ia*@WINDOZEdig iserv.net> wrote:
Hi all,

I don't have ImageMagick installed currently (and not sure if this has the
ability or not anyway yet), but I've done some googling and not come up
with much (if anything) regarding this.
[..]
My server doesn't run X (for obvious reasons? =) ) and I don't _really_
want top have to bloat it out with gnomelibs and the likes to install
Sodipodi on it to do the conversions so was wondering if anyone knew of
anything available to help in the process.


You dont need X to run imagemagick's convert program.
Jul 17 '05 #2
"Martin Wickman" <wi*****@hotbre v.com> schreef in bericht
news:sl******** ************@ba bar.tuffmusik.n u...
You dont need X to run imagemagick's convert program.


Will I need access to my php configuration before I can use ImageMagick with
PHP? I don't have that access but I do need to convert my SVG files to PNG
(or some other raster format). Java isn't enabled in my PHP configuration
either. What now?

Remon.
Jul 17 '05 #3

On 2003-12-25, Remon Huijts <tr*****@hotmai l.com> wrote:
"Martin Wickman" <wi*****@hotbre v.com> schreef in bericht
You dont need X to run imagemagick's convert program.


Will I need access to my php configuration before I can use
ImageMagick with PHP? I don't have that access but I do need to
convert my SVG files to PNG (or some other raster format). Java
isn't enabled in my PHP configuration either. What now?


Just call 'exec("/usr/bin/convert my.svg my.png")' and it will
work. Assuming that your IM installation can handle SVG that is.
Jul 17 '05 #4
"Martin Wickman" <wi*****@hotbre v.com> schreef in bericht
news:sl******** ************@ba bar.tuffmusik.n u...

On 2003-12-25, Remon Huijts <tr*****@hotmai l.com> wrote:
"Martin Wickman" <wi*****@hotbre v.com> schreef in bericht
You dont need X to run imagemagick's convert program.


Will I need access to my php configuration before I can use
ImageMagick with PHP? I don't have that access but I do need to
convert my SVG files to PNG (or some other raster format). Java
isn't enabled in my PHP configuration either. What now?


Just call 'exec("/usr/bin/convert my.svg my.png")' and it will
work. Assuming that your IM installation can handle SVG that is.


Well I tested ImageMagick on my Windows machine a little, though I will be
needing it on a shared Linux server. My first SVG -> PNG convert did not
look very well, but I understand that there is still some work to do in the
ImageMagick support for SVG. Do you happen to know a list of things that are
not supported yet? For instance, looking at the PNG result, my first guess
is that defining styles in a <style> tag is not supported and the transform
attribute seems to be ignored as well.

Remon.
Jul 17 '05 #5
On 2003-12-26, Remon Huijts <tr*****@hotmai l.com> wrote:
"Martin Wickman" <wi*****@hotbre v.com> schreef in bericht
news:sl******** ************@ba bar.tuffmusik.n u...

On 2003-12-25, Remon Huijts <tr*****@hotmai l.com> wrote:
> "Martin Wickman" <wi*****@hotbre v.com> schreef in bericht
>> You dont need X to run imagemagick's convert program.
>
> Will I need access to my php configuration before I can use
> ImageMagick with PHP? I don't have that access but I do need to
> convert my SVG files to PNG (or some other raster format). Java
> isn't enabled in my PHP configuration either. What now?
Just call 'exec("/usr/bin/convert my.svg my.png")' and it will
work. Assuming that your IM installation can handle SVG that is.


Well I tested ImageMagick on my Windows machine a little, though I will be
needing it on a shared Linux server. My first SVG -> PNG convert did not
look very well, but I understand that there is still some work to do in the
ImageMagick support for SVG. Do you happen to know a list of things that are
not supported yet?


Nope, sorry. I just did att quick test with a small svg and it
worked.
For instance, looking at the PNG result, my first guess is that
defining styles in a <style> tag is not supported and the transform
attribute seems to be ignored as well.


I suggesst you read up on http://www.imagemagick.org/ and the mailing
lists for. Why not try to add the needed/broken <style>-support to IM
yourself?
Jul 17 '05 #6
"Martin Wickman" <wi*****@hotbre v.com> schreef in bericht
news:sl******** ***********@bab ar.tuffmusik.nu ...
On 2003-12-25, Remon Huijts <tr*****@hotmai l.com> wrote:

For instance, looking at the PNG result, my first guess is that
defining styles in a <style> tag is not supported and the transform
attribute seems to be ignored as well.


I suggesst you read up on http://www.imagemagick.org/ and the mailing
lists for. Why not try to add the needed/broken <style>-support to IM
yourself?


Can I do that without programming in C? Sadly I could not find any specific
information about SVG support on the ImageMagick site. There was little
discussion about it on the forums as well. On top of that I found out that
my hosting provider does not have ImageMagick installed on the server. So I
decided to step away from ImageMagick, and eat up the SVG with PHP, and spit
out some PNG using the PHP GD library. That kills a lot of the nice
anti-aliasing though...

Remon.
Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
13848
by: Tonio | last post by:
Do any browsers support the use of SVG files as background images through CSS? I haven't been able to get it to work in IE6.
7
5184
by: Dennis Benzinger | last post by:
Hi! Does anybody know of a SVG rendering library for Python? Bye, Dennis
61
4757
by: phil-news-nospam | last post by:
Why does SVG need a different tag than other images? IMHO, SVG should be implemented as an image type just like any other image type, allowing it to work with <img> tags, and ... here is the important part ... also work with backgrounds in other tags. I fail to see any wisdom in making SVG different than say PNG (of course the implementation of the rendering code would obvious be different). --
1
2331
by: Ganesh Palaniappan | last post by:
Would like to know whether any free tool (ActiveX kind of thing) available for SVG-WMF conversion or PNG-WMF conversion. Thanks in advance.
2
5354
by: neilsanner | last post by:
Hi, Is there a way/library to convert a file in SVG format to PNG? neilsanner
1
2013
by: Zhang Weiwu | last post by:
Hello. On one webpage I just worked out, I use svg (by using <object>) for browser that supports svg (firefox), and give an <imginside of <objectas a fallback for IE. http://www.realss.com/workshop/061107 The page looks differently between Fx and IE. On Fx it's the correct look.
4
3762
by: asedt | last post by:
I have used this: http://www.fileformat.info/convert/image/svg2raster.htm To convert SVG files to PNG and JPG, but i need a small program doing the same thing for windows. Prefer no install and small size. Lookked for it and can't find.
1
1289
SMRCA
by: SMRCA | last post by:
Hello to all, I am new in svg and don't have any idea of all functions first let me clear what I want to implement, I want to make a shape in dia that have one textbox, one rectangle on its right side and 2 images in rightmost side, the code is like .....
0
2711
by: vaskarbasak | last post by:
Hi all, I used a png image for our application and it worked fine.But icon's quality is too bad.So our graphics designer made some svg image.I am trying to resize the image in order to fit all different handsets.Also is it possible to use svg image in TiledLayer.I am using J2me. . Thanks!
0
9680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9528
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10228
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10173
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7547
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.