Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It's 100% free, no registration required.

I made a pretty simple checkerboard in inkscape. It is just many boxes that have an outline that is 1 px thick. They overlap by 1 pixels so all lines are one pixel thick and not two. I did this on a 256x256 canvas.

Now I want to export this thing. In the exporting options I chose 256x256 for bitmap size so that it is just a one to one copy of the inkscape file. However, when I export it, only some lines are crisp and black and only one pixels thick. Others are two pixels thick and are dark-grey.

I suppose this is some clever function of inkscape that makes things look nicer usually. But I don't want this, I really want my svg converted to a png one to one.

How can I achieve this?

Thank you for your answers,

Tony

share|improve this question
1  
From Inkscape FAQ: "With the current renderer, it is not possible to completely get rid of antialiasing. However, it is possible to partially suppress it on export. Usually, antialiasing is unwelcome in horizontal and vertical lines which become blurred. To work around this, make sure your horizontal/vertical edges are snapped on the pixel grid, and all strokes are a whole number of pixels wide. Then, export bitmap at the default 90dpi so that 1 px unit corresponds to 1 bitmap pixel. In the resulting bitmap, snapped color boundaries will be perfectly crisp." –  Paolo Gibellini Feb 8 at 15:29
    
Thank you for your answer. I did all of that before but it didn't help. –  fritzi2000 Feb 8 at 15:31

1 Answer 1

up vote 0 down vote accepted

If you want a precise 256x256 pixel raster file containing a 1 pixel checkerboard pattern, you should definitely use a raster program (or program the exact output you want from a programing language).

For example, if you use GIMP (which, as Inkscape is Free both as in Beer and as in Speech), you can simply create a new 256x256 pixel image, and select the Filters->Render->Pattern->Checkerboard option to get your desired image, and file->export to get your output exactly as you want it.

(As an extra note, don't try to save such an image as a JPG file - you'd be losing the pixel precision again. Use PNG or even GIF)

As for your question (I've described how to deal with your problem) - it is the very nature of Vector images not having a "one to one" mapping to pixel images. That is their idea: to allow a geometric description of a scene, instead of having Pixels. With that, they do allow for much more precise arbitrary scale images, using much less computing resources (mainy memory usage). For example, a 3000x2000 pixel image containing a single smooth red circle in it's center could consume up to 18 Megabytes in an uncompressed form - that is roughly equivalent to the textual information contained in 5 full Bibles. (although most file formats use compression that could drastically cut on that). In contrast, the same image described in a vector format which could have the very same look would use at most 1Kb - that is 18000 times less resource consuming - exactly because you don't need to retain the information for each pixel.

In the case described you are trying instead to define one vector object for each pixel. Not only you don't need Vector images re-scaling capabilities, as you are doing the exact opposite of what vector images where first thought for: since each pixel uses 3 bytes of information, and describing a square in a text-based vector format lieke SVG will take about 40 bytes, you are consuming 10 times more resources than you should with this image, instead of sparing any. And moreover, as you found out, subject to rounding errors due to anti-aliasing.

share|improve this answer
    
Thank you for your answer. I do have Gimp, but I find it a pain to use (as opposed to inkscape). WIth your description of what to do, I managed to achieve what I wanted though. :) –  fritzi2000 Feb 9 at 13:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.