Convert .emf image to very big .png,.tiff,.jpg...

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
greg
Posts: 5
Joined: 2019-02-26T07:43:12-07:00
Authentication code: 1152

Convert .emf image to very big .png,.tiff,.jpg...

Post by greg » 2019-02-27T01:55:36-07:00

Hi,

i need to convert a .emf file to a very big image used as terrain for a simulation software.
i used this command:
magick convert -density 16 image.emf image.png

it works but if i use:
magick convert -density 72 image.emf image.png
it will be too slow and crash

is it possible to speed up process ?
is it possible to convert only one part of an .emf file (x,y,width,height) in order to split the image and process ?
if yes, how ?

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

Re: Convert .emf image to very big .png,.tiff,.jpg...

Post by snibgo » 2019-02-27T05:47:16-07:00

How large is the image, in pixels? How much memory do you have?

I suspect you don't have enough memory for the pixels, so they are stored on disk. See http://www.imagemagick.org/script/comma ... .php#limit for methods to limit memory usage, which can prevent disk thrashing.

I don't think IM has any method for converting only part of the EMF file.
snibgo's IM pages: im.snibgo.com

greg
Posts: 5
Joined: 2019-02-26T07:43:12-07:00
Authentication code: 1152

Re: Convert .emf image to very big .png,.tiff,.jpg...

Post by greg » 2019-02-27T06:10:04-07:00

With:
magick convert -density 32 image_ramadi.emf image_ramadi.png
it took me about 1 hour to do the calculation and as a result an image of 22750 x 22761 pixels and 1.6 MB.
it slow down my computer too.

i have an Intel Xenon E3-1246 3.50GHz with 16Go of RAM.

i need very very big image which can have 1million x 1million pixels. Spliting image is necessary but before the computation of the big image to avoid too much computation.

Do you know any other tools than ImageMagick to do this job ?

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

Re: Convert .emf image to very big .png,.tiff,.jpg...

Post by snibgo » 2019-02-27T07:48:06-07:00

greg wrote:Do you know any other tools than ImageMagick to do this job ?
Inkscape. If the image is entirely vector, that's the obvious tool.
snibgo's IM pages: im.snibgo.com

greg
Posts: 5
Joined: 2019-02-26T07:43:12-07:00
Authentication code: 1152

Re: Convert .emf image to very big .png,.tiff,.jpg...

Post by greg » 2019-02-27T08:12:30-07:00

Inkscape crash when i use the export function.

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

Re: Convert .emf image to very big .png,.tiff,.jpg...

Post by snibgo » 2019-02-27T08:38:09-07:00

If you have problems with Inkscape, you should raise that with Inkscape people.

Did you split the image and export just part of it?
snibgo's IM pages: im.snibgo.com

greg
Posts: 5
Joined: 2019-02-26T07:43:12-07:00
Authentication code: 1152

Re: Convert .emf image to very big .png,.tiff,.jpg...

Post by greg » 2019-02-28T00:31:41-07:00

Did you split the image and export just part of it?
With image magick i don't know how to do that.
With Inkscape, i try to export the image without any settings and Inkscape close imediately

User avatar
dlemstra
Posts: 1587
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Convert .emf image to very big .png,.tiff,.jpg...

Post by dlemstra » 2019-02-28T02:49:24-07:00

It looks like it is possible to read part of the exr file on Windows. Could you open an issue on GitHub to request support for this? Not sure if this is possible but we should give it a try.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate

greg
Posts: 5
Joined: 2019-02-26T07:43:12-07:00
Authentication code: 1152

Re: Convert .emf image to very big .png,.tiff,.jpg...

Post by greg » 2019-02-28T06:00:21-07:00

It's possible to load only one part of an .emf file using the win32 API.
i think i will create my own c++ program to convert one .emf file to several splited .bmp files.

Post Reply