Hello,
we are trying to convert a postscript file (created via Smallworld psplot) into a tif that can be displayed on a map. The tif file should be usable for different scales (approx 1:5000 - 1:50000), so we tried to create pyramid tiffs.
However, when zooming out, the lines are very thin. If we zoom in it is very coarse. Below are a set of commands that we tried. The following link contains the tifs created and also the ps file that we tried to convert.
Does someone have an idea how we can get thicker lines and also images that show less "pixelation" on larger scales?
The ps file used is here:
http://borntobike.net/images/tifExample.ps
Various commands we tried (the output tifs are here: http://borntobike.net/images/im-tifs.zip):
convert -type Palette -page 2834x2834 -gravity center -extent 2832x2832+1+1 -background "rgb(255,255,255)" -compress LZW -define tiff:tile-geometry=64x64 tifExample.ps tifExampleExtent.tif
convert -type Palette -dither Floyd-Steinberg -posterize 3 -page 2834x2834 -crop 2832x2832+1+1 -background "rgb(255,255,255)" -compress LZW tifExample.ps tifExampleDither.tif
convert -type Palette -page 2834x2834 -crop 2832x2832+1+1 -background "rgb(255,255,255)" -compress LZW -define tiff:tile-geometry=64x64 tifExample.ps tifExampleNormal.tif
convert -crop 2832x2832+1+1 -compress LZW -resize 25% -type Palette -page 2834x2834 -resample 300x300 -background "rgb(255,255,255)" -define tiff:tile-geometry=64x64 tifExample.ps tif300x300.tif
convert -crop 2832x2832+1+1 -compress LZW -type Palette -page 2834x2834 -background "rgb(255,255,255)" -define tiff:tile-geometry=64x64 tifExample.ps tifExampleNormalCropFirst.tif
convert -crop 2832x2832+1+1 -compress LZW -type Palette -page 2834x2834 -define tiff:tile-geometry=64x64 tifExample.ps tifExampleNoBackgr.tif
convert -compress LZW -type Palette -page 2834x2834 -crop 2832x2832+1+1 -background "rgb(255,255,255)" -define tiff:tile-geometry=64x64 tifExample.ps tifExampleNormalCmprFirst.tif
Thanks a lot,
bjorn
Converting ps to tif with thicker lines
-
- Posts: 2
- Joined: 2012-06-26T05:02:56-07:00
- Authentication code: 13
- whugemann
- Posts: 289
- Joined: 2011-03-28T07:11:31-07:00
- Authentication code: 8675308
- Location: Münster, Germany 52°N,7.6°E
Re: Converting ps to tif with thicker lines
First of all, you should set -density before converting the PS file, rather than resizing it later.
I think the problems with the lines cannot be solved in an easy way, at least not with IM alone. When converting a vector drawing into a pixel-based format, there are problems with line widths, which will turn out differently at different resolutions. So I guess you should possibly use a script that alters the line widths in a suitable way *before* converting it to a raster image. A quick check of your PS file with Acrobat Professional revealed that some of your lines are rather thin, close to hairlines.
I think the problems with the lines cannot be solved in an easy way, at least not with IM alone. When converting a vector drawing into a pixel-based format, there are problems with line widths, which will turn out differently at different resolutions. So I guess you should possibly use a script that alters the line widths in a suitable way *before* converting it to a raster image. A quick check of your PS file with Acrobat Professional revealed that some of your lines are rather thin, close to hairlines.
Wolfgang Hugemann
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Converting ps to tif with thicker lines
The problem is that postscript (from whcih PDF was developed) was created when resolutions wasn't that great.
The default thickness for lines in postscript is 'as thin as possible'. Which with higher resolutions is now causing problems, and with low resolution creates fairly thick lines.
It is the way it is.
SVG gets similar problems when the graphic artist uses image pixels, rather than points or other real world measurements, for the lines and objects being drawn in the SVG language.
The default thickness for lines in postscript is 'as thin as possible'. Which with higher resolutions is now causing problems, and with low resolution creates fairly thick lines.
It is the way it is.
SVG gets similar problems when the graphic artist uses image pixels, rather than points or other real world measurements, for the lines and objects being drawn in the SVG language.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
-
- Posts: 2
- Joined: 2012-06-26T05:02:56-07:00
- Authentication code: 13
Re: Converting ps to tif with thicker lines
Hello Wolfgang and Anthony,
thanks for your explanations. Regarding the hairline widths in the postscript, which lines are those? I saw linewidth only on two places, once with 0 and once with 1. Changing them to higher values did not produce different results. I saw in a doc about ps that linewidth can be altered through "ngsetr", but that tag doesn't appear in my sample ps file. Or is it the swline command?
Thanks,
bjorn
thanks for your explanations. Regarding the hairline widths in the postscript, which lines are those? I saw linewidth only on two places, once with 0 and once with 1. Changing them to higher values did not produce different results. I saw in a doc about ps that linewidth can be altered through "ngsetr", but that tag doesn't appear in my sample ps file. Or is it the swline command?
Thanks,
bjorn