Remove unwanted beveling from lines

Post questions on how to use or achieve an effect in Inkscape.
electricwrite
Posts: 2
Joined: Thu Sep 18, 2014 10:46 pm

Remove unwanted beveling from lines

Postby electricwrite » Thu Sep 18, 2014 11:02 pm

Hello,

I've been getting a strange effect when I use inkscape to export to PNG. I don't know whether the root of the problem is in the objects that the SVG file contains or in the export function.

My SVG file consists of parallel (and perpendicular lines) that need to be printed at very high resolution (~25400 DPI). When I look at the lines in inkscape, they are the correct size and pure black & white. However, when I export the file as a PNG and look at them with gimp, they have some grayscale beveling added (beveledlines.png).

I have also attached the screen that I see when I highlight some of the lines in inkscape. The lines are intended to be 0.003 mm wide and the same distance away from each other. When I use inkscape to zoom into them, they are perfectly black & white, the right size and spaced correctly (inkscape_screen.png).

I convert to PNG using the following command:
inkscape --export-png=inkout.png --export-width=12000 --export-height=12000 testpiece.svg

I get output that looks like this:
Background RRGGBBAA: ffffff00
Area 0:0:42.5197:42.5197 exported to 12000 x 12000 pixels (25400 dpi)
Bitmap saved as: inkout.png

Does anyone know how to turn these beveled lines into plain black lines with white spaces? I am using inkscape 0.48 on linux.
Attachments
inkscape_screen.png
inkscape_screen.png (90.16 KiB) Viewed 2984 times
beveledlines.png
beveledlines.png (237 Bytes) Viewed 2984 times

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Remove unwanted beveling from lines

Postby Lazur » Fri Sep 19, 2014 12:16 am

Hi.


First off, if you are interested in higher accuracy, set it at the inkscape preferences (Shift+Ctrl+P) under the svg output tab before drawing.

For an accurate printing you better keep your work in vectors.
But if you need it as rasters for a good reason, keep in mind that by exporting at 25400 dpi, all the inaccuracy of your work will be multiplied by 282,2222.
Maybe your exporting area is misaligned to the lines in a small bit too?

Preferably design your work exactly in 12000/12000 pixel size, with lines having a 3 px width, all elements falling on the pixel grid, and, export at 90 dpi.



I'm a bit confused though about this, regular printers go 2400 dpi at the max.
0,003 mm =3 µm=3000 nm, and the wavelengths go from 380-750 nm in the spectrum of light.
Is this for somekind of optical diffraction filter?

electricwrite
Posts: 2
Joined: Thu Sep 18, 2014 10:46 pm

Re: Remove unwanted beveling from lines

Postby electricwrite » Fri Sep 19, 2014 3:17 am

Hi,

This will be printed with a special tool that can do 50,000 dpi.

The lines are aligned: 25400 dpi makes the smallest point one micron in size. Unfortunately, the tool can only take DXF or PNG. The DXF export function in Inkscape does not work with patterns this small.

What I dont understand is whether the beveling is due to the bitmap export function or if it is attached to the objects in the SVG.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Remove unwanted beveling from lines

Postby Lazur » Fri Sep 19, 2014 5:51 am

Exported at 90 dpi this 12000/12000 px sized image with 3 px wide "lines" comes out crystal sharp.

Maybe you are using stroked paths that produces such rendering issue?
Attachments
hlp150.svg
(680.23 KiB) Downloaded 171 times

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Remove unwanted beveling from lines

Postby druban » Fri Sep 19, 2014 10:14 am

Make a pixel grid and see if your lines are actually aligned to this grid when zoomed in. Don't try to set the printing DPI in Inkscape. Do it in the GIMP. Leave the inkscape DPI at 90 and set the canvas dimensions to what you want in pixels. Make sure your grid is aligned to your canvas as well. Remember that stroked lines (as you have here) are offset half the width of the stroke when snapping to a grid. If you want to export a precise raster image, all dimensions should be in pixels. The 'beveling' is antialiasing during the export. Only precise alignment will remove it. Your stroke width is in mm. Your resolution is in inches. You want your final result to be pixel accurate. You see where I'm going with this? :)
HTH.

Both Lazur(mostly) and I(little) responded in detail to a similar question Here

How can I keep the ads from doing this? (I can zoom in and change where they overlap but then I can't see the whole page anymore) can the ads be drawn first?
Capture.PNG
Capture.PNG (147.15 KiB) Viewed 2924 times
Your mind is what you think it is.

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Remove unwanted beveling from lines

Postby tylerdurden » Fri Sep 19, 2014 12:31 pm

druban wrote:How can I keep the ads from doing this? (I can zoom in and change where they overlap but then I can't see the whole page anymore) can the ads be drawn first?

I usually just open the image in a new tab or window. :-\
Have a nice day.

I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1

The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Remove unwanted beveling from lines

Postby Lazur » Fri Sep 19, 2014 6:54 pm

druban wrote:...Your stroke width is in mm. Your resolution is in inches. You want your final result to be pixel accurate. You see where I'm going with this? :) ...


That was my first thought too.
But then
0,003 mm @ 25400 dpi=0,003/25,4*25400=3 px.

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Remove unwanted beveling from lines

Postby druban » Sat Sep 20, 2014 6:08 am

Lazur URH wrote:That was my first thought too.
But then
0,003 mm @ 25400 dpi=0,003/25,4*25400=3 px.

Yes but a 3 pixel stroke is 1.5 px on either side of the line. If the line is snapped to a pixel measure then you are drawing (trying to draw) a half pixel on either side, right? To render without AA, stroked lines have to have even pixel number strokes (if they are snapped to pixel locations).

Edit: @Lazur I see you asked above: "Maybe you are using stroked paths..." If you look under the book ad you will see that he /she is.

@OP there's a very subtle thing going on here - when you say you zoom in inkscape the lines are perfectly sharp. That's a rendering too, a screen render. It's entirely different from the export render, although it uses the same engine (or maybe not, the screen render might use openGL and the export render not?). However the screen render is counting its pixels from the edge of the screen, but your export is counting its pixels from the edge of the export area. And the zoom does not reveal any more: the screen AA smoothing is only one screen pixel wide NO MATTER HOW FAR YOU ZOOM IN so you can't ever really examine it! (you could take a screenshot at different zooms and look very closely) Does that make sense?
Your mind is what you think it is.


Return to “Help with using Inkscape”