vector to raster conversion (SVG)



Core Graveyard
18 years ago
2 years ago


(Reporter: rvj, Unassigned)


(Depends on: 2 bugs, {helpwanted})

Dependency tree / graph

Firefox Tracking Flags

(Not tracked)


(Whiteboard: [parity-ie])



18 years ago
I would like to be able to use SVG for image editing but be able to generate a 
bitmap image if appropriate (GIF, PNG, JPG, etc).

Any chance of a very simple API for vector to raster conversion?

API would require

a) output filename/directory
b) output image format (PNG, JPG, GIF, etc)
c) image size in pixels (200x300)
d) color depth in pixels (8/16/24/etc)

Or is there a way of doing this already?
This is a _Mozilla_ bug?!
Assignee: dean.jackson → mjudge
Component: SVG → Image Conversion Library
QA Contact: dean.jackson → tpreston


18 years ago
Severity: normal → enhancement
Summary: RFE vector to raster conversion (SVG) → [RFE] vector to raster conversion (SVG)

Comment 2

18 years ago
Heh. Certainly not - this Bugzilla only handles bugs and feature requests for
Mozilla. SVG is a standard and product of Adobe if I recall correctly. Marking
Last Resolved: 18 years ago
Resolution: --- → INVALID

Comment 3

18 years ago
We are not Adobe Photoshop. We do have some sort of cvs tree for SVG stuff,
quite what the state/purpose of it is I do not know. However saving from SVG to
raster formats is not the job of a web browser. Use the right tool for the right
job :).

Unless, of course, we've all gotten the wrong end of the stick with your bug

Verified Invalid.

Comment 4

18 years ago
I'm surprised by some of the follow up comments - particularly that the idea 
that Mozilla is just a browser. I doubt if most of the XPFE group see it in 
those terms.

Chatzilla, Composer, etc all provide editing functionality. I believe someone 
has already built a editor based around SVG. 

What is required a VERY BASIC method of dumping a bitmap representation of the 
screen (just as you could/can with VB - the Printform method if I remember 
correctly). We are not talking Photoshop here!!!!

If on the otherhand you are saying that SVG is no longer Mozilla's choice of 
vector drawing tool - then what is?? 


Comment 5

17 years ago
PS I have temporarily reopened this RFE as I suspect once marked as INVALID,  
follow up comments/queries dont get seen/responded to. !

Resolution: INVALID → ---

Comment 6

17 years ago
Marking new to aid discussion.
Ever confirmed: true

Comment 7

17 years ago
PS It may be that SVG is not the main issue here (functionality wise) but a 
general need for a window handle that allows a selected bit of the window area 
to be saved (like Printform). 

I will attempt to explore use of scripted cut and paste , together with  save 
as file (GIF, PNG, etc) functions

Comment 8

17 years ago
moving to future
Keywords: helpwanted
Priority: -- → P5
Target Milestone: --- → Future

Comment 9

17 years ago
back to SVG component
Component: Image Conversion Library → SVG

Comment 10

17 years ago
Come on, this *is* INVALID, right?

Comment 11

17 years ago
Really invalid ?

Well I can only say that some kind of 'Save as .. ' gif or png feature is 

If such functionality already exists great - then  please let me know. 

Mozila has the beginnings of a page editor but say you want to include a screen 
shot of the contents of an iframe. I am not aware of any Mozilla functionality 
that allows this. 

Seems that the most general solution is to have a 'Save as ' function for the 
contents of an iframe (which could be  HTML, XML, SVG content).

Unlike some follow up comments relating to professional imaging packages - I am 
looking for something very simple - the ability to take iframe screenshots 
(using javascript) 


Comment 12

17 years ago
PS ..... or could the printing component be used to achieve this. ie. Print the 
contents of an iframe to a file ( in gif or png) format ?

Does the print component have the ability to save in a particluar graphics 

Comment 13

17 years ago
A more appropriate title might be "Capturing iframe content as raster"

As Ive said before Im quite happy have this RFE closed but before it is can 
anyone clarify which Mozilla APIs allow the contents of Mozilla iframes (htm, 
svg, xml, etc) to captured and saved.?

Can (or is) the print component the most likely component that would provide a 
method of saving iframe content in raster  format  (e.g. PNG)?

If not, can anyone suggest which component category this RFE should be filed.?

Theres a debug-only api which saves to a ppm. Its useful for debugging purposes,
so this is possible, in theory. Batik allows you to do this.

Comment 15

16 years ago
What about implementing this via the printing API ?

Comment 16

16 years ago

I filed a request for such an enhancement to the printer API

to allow this which I believe you triaged. Bug 113231. 

Since bug 113231 now appears to have been adopted (it has assigned status) this 
enhancement request (64074) can be closed.

I only left it open for some feedback.

Comment 17

16 years ago
The now defunct Eazel wrote a library for rasterising SVG as part of Nautilus
quite a few open source projects use it.  It is licensed under the LGPL.  it is
in Gnome CVS

Google produces quite a few links, but Librsvg does not seem to have a homepage
of its own or anything like that.


16 years ago
Summary: [RFE] vector to raster conversion (SVG) → vector to raster conversion (SVG)

Comment 18

14 years ago
I can see this being useful, but SVG is most certainly not the right component
to implement this functionality in. You'd want to be able to do this for any xml
content, so the best way to attack this would probably be on the
nsRenderingContext level.
GFX seems a more appropriate component -> reassigning.
Assignee: mjudge → general
Component: SVG → GFX
QA Contact: tpreston → ian

Comment 19

11 years ago
If you're JS in chrome, you can just load the SVG into an iframe, use drawWindow on a canvas, and then use toDataURI to get out a PNG.  Is there anything else needed here?
Product: Core → Core Graveyard
Yeah, Canvas seems to provide the desired functionality to the extent that it can without security issues.
Last Resolved: 18 years ago6 years ago
Resolution: --- → FIXED

Comment 21

6 years ago
(In reply to Eli Friedman from comment #19)
> If you're JS in chrome, you can just load the SVG into an iframe, use
> drawWindow on a canvas, and then use toDataURI to get out a PNG.  Is there
> anything else needed here?

A way to convert SMIL animation to animated PNG.
Resolution: FIXED → ---
IE10 allows a user to "Save Picture as…" on an SVG document and save it as a PNG or BMP.
Whiteboard: [parity-ie]


4 years ago
Depends on: 999934


2 years ago
Depends on: 1235179
You need to log in before you can comment on or make changes to this bug.