Page 1 of 1

Blurry when EMF image converted to JPG or PNG

Posted: 2012-10-03T09:35:41-07:00
by pmalireddy
Hi,

I am using 6.7.7-10-Q16 on windows to convert an EMF image to JPG. I am sorry here that I wont be able to provide the image as it needs high level permissions, which I wont be able to get.

Its not that all EMF images when converted looks blurry. Its only a particular type of image that has got the problem.
In brief the content of that image would be : a line or bar chart with some data points (text) in it. When converted to JPG/PNG, the chart as such looks fine, but the text is very blurry and bold.

This was not the case with ImageMagick 6.4.3 version though. We are moving to 6.7.7 to actually correct blurriness in text in another set of images (Tabular data EMF images). And now we have a problem with chart data image conversion with 6.7.7

Below is the command I try to convert:
convert.exe image1.emf -resize XxY -flatten image2.jpg

I also have tried other convert options like -unsharp/sharpen, -blur, -sampling-factor, -filter and it dint work.

Can someone please help me here ? I would appreciate it very much.

Thanks,
Pradeep.

Re: Blurry when EMF image converted to JPG or PNG

Posted: 2012-10-03T10:00:00-07:00
by fmw42
I know little about EMF and am not a Windows user, but if it is similar to vector formats that have no size and rely upon -density, then use supersampling..

Try

convert -density 288 image.emf -resize 25% image.png

Note normal density is 72. So 72*4=288 and 25%=1/4

So we are enlarging the vector format, converting to raster and then shrinking back the the nominal size.

Re: Blurry when EMF image converted to JPG or PNG

Posted: 2012-10-04T08:25:24-07:00
by pmalireddy
Thanks. I tried this as well, and its still the same - the text in the image is blurry.

I have observed one other detail: when I open up the emf image in MS Paint, it looks the same as the converted jpg. Only when it is opened in other viewers like Windows Picture and Fax viewer, the text in image looks good. Seems the EMF I have is a combination of vector graphics and bitmap data. And that bitmap data is not some clear enough for imagemagick to convert fine. Does this make any sense ?

Re: Blurry when EMF image converted to JPG or PNG

Posted: 2012-10-06T03:51:14-07:00
by whugemann
EMF is a vector format and text is displayed as a vector object, i.e. defined by its oulines discribed in terms of Bezier curves. If you convert this into a raster graphic, it becomes blurry, especially as the rasterisation hints in the font file are usually ingnored by generic raster processors such as ImageMagick.

I think that Fred's approach is basically correct, but text rasterised at 72 dpi will always look blurry, no matter how sophisticated you proceed, I guess. I could tell you more if you would provide a link to the original EMF.

BTW: The Metafile Companion (http://companionsoftware.com) is a good tool to analyse and modify EMF files.