Post Reply 

maintain vector stroke width during rasterization import?

May 18, 2012, 17:18 (This post was last modified: May 18, 2012 17:19 by leeoniya.)
Post: #1
maintain vector stroke width during rasterization import?
Hi,

I was wondering if there was any way to maintain stroke width (with antialiasing off) when importing/resampling vector files, like pdf. photoshop does this, i think.

i made a test case that shows the issue in the attached files. the PDF is a 1px-stroked square. when i try to rasterize it to 100dpi (or any dpi other than 72) using Gimp or any tool that relies on ghostscript for rasterization (imagemagick, mupdf, xpdf) i get a square with unevenly stroked edges. photoshop's algo maintains the stroke width in favor of maybe less optimal positioning.

is there any way to make Gimp or any other pdf->png rasterization tool (ghostscript included) prioritize stroke widths over positioning?

thanks!

original:

.pdf  drawing.pdf (Size: 960 bytes / Downloads: 76)

gimp:
   

photoshop:
   
Find all posts by this user
Quote this message in a reply
May 18, 2012, 19:28
Post: #2
RE: maintain vector stroke width during rasterization import?
A PDF contains vector graphics, so the best tool is a vector graphics editor such as Inkscape. If I import your file in inkscape, the square isn't even stroked (but in any case you can redefine the fill/stroke).

Once there you have several options:
  • do your processing in Inkscape all the way (recommended if it's all vector graphics)
  • scale/edit in Inkscape, then export as PNG or the required size, and import the PNG in Gimp for more bitmap editing.
  • save as SVG in Inkscape, then start Gimp on new image, import SVG in Gimp as Path, and scale/stroke path in Gimp, and continue with bitmap editing

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
May 18, 2012, 22:20
Post: #3
RE: maintain vector stroke width during rasterization import?
i popped it open in inkscape and the stroke looks ok to me.

anyhow, i understand the difference between raster and vector. i actually NEED this rasterized because i'm writing image analysis code for HTML5/canvas that does feature detection. this is not being rasterized for editing/manip.
Find all posts by this user
Quote this message in a reply
May 18, 2012, 23:41
Post: #4
RE: maintain vector stroke width during rasterization import?
So Inkscape/File/Export Bitmap is your friend Smile

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Stroke path problem. caz 3 356 Aug 2, 2014 13:28
Last Post: caz
  Stroke path options MartinT 1 309 May 18, 2014 19:12
Last Post: ofnuts
  wrong import bitmaps with gimp 2.8.10 (Fedora 20) mario.storti 11 768 Apr 9, 2014 11:11
Last Post: mario.storti
  Hi Gimp Users, brush stroke effect suggestion? PNGer 5 897 Apr 8, 2014 11:38
Last Post: PNGer
  Import paths? No, import them correctly! Marscaleb 4 514 Mar 1, 2014 07:35
Last Post: iForStyle007

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS