SVG 2 TIFF Group 4 conversion

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
HermannArya
Posts: 1
Joined: 2014-05-23T14:17:42-07:00
Authentication code: 6789

SVG 2 TIFF Group 4 conversion

Post by HermannArya »

Hi there,

I am trying to convert some black and white SVG graphics into TIFF Group 4 compressed files.

Actually to be precise, I managed to create a TIFF Group 4 compressed file from the SVG file but the quality was quite bad. I used XnView earlier for the same task which worked very well but this will not run in the environment I would need it to be executed. I got very small files and a good quality.

I am pretty sure that ImageMagick could also achieve the same, if only I would know which command to use exactly!

I have been playing around with various parameters but the created image always tends to look "fuzzy" once created.

This is the basic command I am using:

convert -compress group4 "test.svg" "test.tiff"

I uploaded a test SVG file and the resulted TIFF file here:

http://webftp.tid-informatik.de/cgi-bin ... ce3c4f&a=1

Here some facts:
I am running on windows 7 64bit
using version ImageMagick 6.8.9-1 Q16 x64 2014-05-08
The provided SVG file contains no color

It would be great to hear from you guys. Let me know if you have any questions

Kind regards

Hermann Arya
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: SVG 2 TIFF Group 4 conversion

Post by fmw42 »

Your result looks fine to me at full resolution. Are you viewing in a mode that fits the image to the window? If so, you will get aliasing of thin lines in the viewer, but the image should be fine. However, the group 4 compression does alias it somewhat compared to no compression, since it removes (converts to binary) the antialiasing of the text and lines that is specified in the svg code. That is simply a fact of group 4 compression (or any compression from 8-bits to 1-bit binary)

Try putting -compress after the svg file and before the output

Code: Select all

convert test.svg -compress group4 test1.tiff
Or do your own thresholding prior to compressing

Code: Select all

convert test.svg -threshold 80% -compress group4 test2.tiff
adjust the threshold to suit.
Post Reply