Issues converting image

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Sri79
Posts: 5
Joined: 2016-05-02T04:28:40-07:00
Authentication code: 1151

Issues converting image

Post by Sri79 »

Hi,

I was using ImageMagick version 6.7.3 for quite a long time. Recently thought to use the latest version. However, the image conversion is not so good with the recent version. I am trying to convert the EMF format file to JPG format.

Source image in emf format:
https://onedrive.live.com/redir?resid=B ... file%2cemf

Converted using V6.7.3
Image

Converted using V7.0.1
Image

Please fix.

Thanks
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Issues converting image

Post by snibgo »

EMF is a Microsoft format. The default result from the conversion done by ImageMagick v6.9.2-5 (EDIT and v7.0.1-0) is identical to the result from Microsoft Paint.

The image is vector, so if you want more legibility from the IM conversion, precede it with "-density 300" or other number.

EDIT to add: The image is solid colours, so PNG is a better format that JPG because it doesn't change the colours, and the file is much smaller.
snibgo's IM pages: im.snibgo.com
Sri79
Posts: 5
Joined: 2016-05-02T04:28:40-07:00
Authentication code: 1151

Re: Issues converting image

Post by Sri79 »

Thanks for quick reply. I will give a try.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Issues converting image

Post by snibgo »

See also my edit above about the JPG format.
snibgo's IM pages: im.snibgo.com
Sri79
Posts: 5
Joined: 2016-05-02T04:28:40-07:00
Authentication code: 1151

Re: Issues converting image

Post by Sri79 »

Ok thanks. The suggestion you gave resolves my problem.

I am allowed to use JPG or GIF only. So, which one is better JPG or GIF?

Or if we temporarily convert the EMF to PNG and then to JPG or GIF, will it give better quality?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Issues converting image

Post by snibgo »

There is no advantage in converting to PNG, then from PNG to something else. I suggest you convert directly to your final format.

If you have less than 256 colours, GIF will give you an exactly correct result. JPG won't. The default JPG from this image is 5 times larger than the GIF.
snibgo's IM pages: im.snibgo.com
Sri79
Posts: 5
Joined: 2016-05-02T04:28:40-07:00
Authentication code: 1151

Re: Issues converting image

Post by Sri79 »

Okay. I do not know whether the image will be 256 colors or not. Is there anyway we can check whether an image has less than 256 colors or more?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Issues converting image

Post by snibgo »

Code: Select all

convert source.emf -unique-colors -format %w info:
The output is:

Code: Select all

58
snibgo's IM pages: im.snibgo.com
Sri79
Posts: 5
Joined: 2016-05-02T04:28:40-07:00
Authentication code: 1151

Re: Issues converting image

Post by Sri79 »

ok. Thanks a lot :)
Post Reply