Discussion:
Large multi-tiff files
Andrea Parenti
2011-11-08 16:22:17 UTC
Permalink
Dear magick-users,

I have a question about writing multi-tiff files using the MagickWand
interface. My understanding is that I have to:

- initialize everything ie (MagickWandGenesis(), wand=NewMagickWand())
- add the images to the wand: MagickConstituteImage(wand, ...)
- write the file: MagickWriteImages(wand, ...)

This is indeed working, but I get into trouble when I try to write a
large number of large images to a single file: all images are first stored
in memory (wand), then written to a file, and memory occupation starts to
grow. Is there any solution to this?

Thank you very much!

Regards,
Andrea Parenti


------------------------------------------------------------
Dr. Andrea Parenti DESY (FS-EC Group)

mail: ***@desy.de Notkestrasse 85
web: http://www.desy.de/~parenti/ D-22607 Hamburg
phone: +49 (0)40 8998 3154 Germany
------------------------------------------------------------
d***@imagemagick.org
2011-11-08 17:16:49 UTC
Permalink
and memory occupation starts to grow.
Use MagickSetResourceLimit(). Set your memory limit to 1GB and anything
more than that will be cached to disk instead of memory.
Anthony Thyssen
2011-11-09 01:42:43 UTC
Permalink
On Tue, 8 Nov 2011 17:22:17 +0100 (CET)
Andrea Parenti <***@desy.de> wrote:
| Dear magick-users,
|
| I have a question about writing multi-tiff files using the MagickWand
| interface. My understanding is that I have to:
|
| - initialize everything ie (MagickWandGenesis(), wand=NewMagickWand())
| - add the images to the wand: MagickConstituteImage(wand, ...)
| - write the file: MagickWriteImages(wand, ...)
|
| This is indeed working, but I get into trouble when I try to write a
| large number of large images to a single file: all images are first stored
| in memory (wand), then written to a file, and memory occupation starts to
| grow. Is there any solution to this?
|
| Thank you very much!
|
| Regards,
| Andrea Parenti
|
What file format? Some file formats allow you to simply concatenate images
together to create a multi-image file.


Best idea is to post your question on the IM discussion forums
This has more users, and answers remain available for others to use.
http://www.imagemagick.org/discourse-server/index.php

Anthony Thyssen ( System Programmer ) <***@griffith.edu.au>
--------------------------------------------------------------------------
"Happy surfing to all, and to all a good byte!"
--- A Network Christmas Story -- Hugh Drumm & Vincent Ambrose
--------------------------------------------------------------------------
Anthony's Castle http://www.ict.griffith.edu.au/anthony/
Andrea Parenti
2011-11-10 08:23:30 UTC
Permalink
Post by Anthony Thyssen
On Tue, 8 Nov 2011 17:22:17 +0100 (CET)
| Dear magick-users,
|
| I have a question about writing multi-tiff files using the MagickWand
|
| - initialize everything ie (MagickWandGenesis(), wand=NewMagickWand())
| - add the images to the wand: MagickConstituteImage(wand, ...)
| - write the file: MagickWriteImages(wand, ...)
|
| This is indeed working, but I get into trouble when I try to write a
| large number of large images to a single file: all images are first stored
| in memory (wand), then written to a file, and memory occupation starts to
| grow. Is there any solution to this?
|
| Thank you very much!
|
| Regards,
| Andrea Parenti
|
What file format? Some file formats allow you to simply concatenate images
together to create a multi-image file.
Best idea is to post your question on the IM discussion forums
This has more users, and answers remain available for others to use.
http://www.imagemagick.org/discourse-server/index.php
--------------------------------------------------------------------------
"Happy surfing to all, and to all a good byte!"
--- A Network Christmas Story -- Hugh Drumm & Vincent Ambrose
--------------------------------------------------------------------------
Anthony's Castle http://www.ict.griffith.edu.au/anthony/
The file format is tiff. I don't think two single-page tiff files can be
just concatenated to have a two-page tiff file. Am I wrong?

Andrea
Fred Weinhaus
2011-11-10 17:21:10 UTC
Permalink
Unless there is something odd about you tiff files, this should work fine

convert rose: rose.tiff
convert rose.tiff rose.tiff rose2.tiff
identify rose2.tiff
rose2.tiff[0] TIFF 70x46 70x46+0+0 8-bit DirectClass 19.9KB 0.000u 0:00.000
rose2.tiff[1] TIFF 70x46 70x46+0+0 8-bit DirectClass 19.9KB 0.000u 0:00.019

result shows two frames/layers
Post by Andrea Parenti
The file format is tiff. I don't think two single-page tiff files can be
just concatenated to have a two-page tiff file. Am I wrong?
Loading...