Mobile app version of vmapp.org
Login or Join
Jessie844

: From Inkscape in Linux to Windows, changing bitmap resolution I was creating a splashpage for an app I'm working on at work, using my personal laptop with Ubuntu (14.04) and Inkscape. We use

@Jessie844

Posted in: #Inkscape #Linux #Png #Windows

I was creating a splashpage for an app I'm working on at work, using my personal laptop with Ubuntu (14.04) and Inkscape. We use a framework at work that requires precise dimensions, but I could not initially find those dimensions so I figured svg's would be ideal for me to keep my image in (as opposed to using GIMP.) I would export to a png with a specific size as I iteratively got closer to what I wanted.

I was using known working png's as a dimensional guide, and when viewed in MS Paint and Windows Photo Viewer, both the examples and my png looked exactly the same size and had the same properties, in both dimensions and DPI (as given by Paint).

However, when I opened my png with the app, my image would consistently pixelate and uglify, and be expanded some percentage (probably less than 10%) beyond the visible borders of the canvas.

After enough digging through the code, I found the specific dimensions (which one of my examples also had), defined in xaml, I think specifically denoted as
schemas.microsoft.com/winfx/2006/xaml

but I do not know much about xaml, except that it appears to be an xml.

I set my image to that specific size, but I still had the pixelation problem. Then I noticed that I was exporting at 90 DPI (dots per inch) but that Paint said I was at 96 DPI. I first tried adjusting my export DPI, but then my dimensions would grow larger. Sensing the problem was in the png metadata, I then tried to specify it on the command line with

inkscape image.svg -e image.png -d 96 -C -wXXX -hXXX


which should let me specify both width and height in pixels as well as the DPI. But that didn't work.

I finally managed a workaround by setting my SVG in a lower dimension that, when I expanded from 90 to 96 DPI on export, expanded the dimensions to that precisely required in the xaml.

My question is, was my workaround actually the right way to do this, is there some kind of bug in Inkscape that caused me to have to do this, is it that the metadata is somehow mispecified, or is it that the xaml is using (perhaps deprecated) metadata that the other applications in Windows ignored?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Jessie844

1 Comments

Sorted by latest first Latest Oldest Best

 

@Goswami567

When Inkscape exports to bitmap formats it defaults to rasterising full size at 90dpi.
As you ask Inkscape to increase the pixel dimensions of your export it will likewise increase the dpi setting.

If you want to export your svg at a specific pixel size you should scale your artwork to that size before exporting.

This isn't an Inkscape bug but appears to be a limitation if you're used to exporting from other illustration apps where you can specify both the dimensions and dpi.

Can't comment on the xaml parts of question but I think that when you're comfortable that Inkscape has a default 90dpi export resolution all of the other issues will fall away.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme