[Mapserver-users] help with ImageMagick & gdal utilities

Benjamin Thelen thelen at ccgis.de
Wed Mar 31 06:54:43 EST 2004


Hello,

I have 300 24bit tif images (6400x6400) which need to be resized and 
converted to 8bit.

There are some problems and I suppose that most of you might have 
quite an experience with ImageMagick and the gdal utilities.


Converting & resizing (convert / mogrify) with ImageMagick stops with 
"Memory allocation failed", allthough it is a machine with 512M of 
RAM, enough swap (1G) and enough /tmp (60G). Converting an image with 
a size up to 5400x5400 runs through (I resized one tif with 
IrfanView), but it takes incredible long, compared to gdal_translate 
or Windows IrfanView.

Also all the tiff-headers (tags) are lost, see the tiffinfo output 
below. This is also true for both gdal utilies (gdal_translate and 
rgb2pct.py).


I would be happy about some general feedback, experiences, tips and of 
course solutions :-)!


Thank you very much,
Benjamin


---------------------------------
CCGIS GbR - Bonn
http://www.ccgis.de

Siemensstraße 8
53121 Bonn
Germany

Tel: ++49 (0) 228 90826 15
Fax: ++49 (0) 228 90826 11




Original:

Subfile Type: (0 = 0x0)
   Image Width: 6400 Image Length: 6400
   Resolution: 160, 160 pixels/cm
   Bits/Sample: 8
   Compression Scheme: None
   Photometric Interpretation: RGB color
   FillOrder: msb-to-lsb
   Artist: "(c) XXXXXXXXXXXXXXX"
   Date & Time: "1999:06:26 00:00:00"
   Image Description: "XXXXX"
   Orientation: row 0 top, col 0 lhs
   Samples/Pixel: 3
   Rows/Strip: 7008
   Min Sample Value: 0
   Max Sample Value: 255
   Planar Configuration: single image plane
   Page Name: "3414000 5650000 3416000 5652000"
   Tag 37522: 5000
   Tag 37523: 305
   Tag 37524: 3414000,5650000,3416000,5652000
   Tag 37525: 0
   Tag 37527: 1,6400,6400,1


After rgb2pct.py:

TIFF Directory at offset 0x271ce9e
   Image Width: 6400 Image Length: 6400
   Bits/Sample: 8
   Sample Format: unsigned integer
   Compression Scheme: None
   Photometric Interpretation: palette color (RGB from colormap)
   Samples/Pixel: 1
   Rows/Strip: 1
   Planar Configuration: single image plane
   Color Map: (present)



After ImageMagick:

TIFF Directory at offset 0x1d4c08
   Image Width: 800 Image Length: 800
   Resolution: 406, 406 pixels/inch
   Bits/Sample: 8
   Compression Scheme: None
   Photometric Interpretation: RGB color
   FillOrder: msb-to-lsb
   Document Name: "XXX.tif"
   Orientation: row 0 top, col 0 lhs
   Samples/Pixel: 3
   Rows/Strip: 3
   Planar Configuration: single image plane
   Software: ImageMagick 5.5.7 03/16/04 Q16 http://www.imagemagick.org




I also had a few errors with rgb2pct.py:

.
.
.
eError: not enough arguments for format string
Traceback (most recent call last):
   File "./rgb2pct", line 96, in ?
     print '%s has %d bands, need 3 for inputs red, green and blue.' \
TypeError: not enough arguments for format string
Traceback (most recent call last):
   File "./rgb2pct", line 96, in ?
     print '%s has %d bands, need 3 for inputs red, green and blue.' \
TypeError: not enough arguments for format string
Traceback (most recent call last):
   File "./rgb2pct", line 96, in ?
     print '%s has %d bands, need 3 for inputs red, green and blue.' \
TypeError: not enough arguments for format string
Traceback (most recent call last):
   File "./rgb2pct", line 96, in ?
     print '%s has %d bands, need 3 for inputs red, green and blue.' \
TypeError: not enough arguments for format string
Traceback (most recent call last):
   File "./rgb2pct", line 96, in ?
     print '%s has %d bands, need 3 for inputs red, green and blue.' \
TypeError: not enough arguments for format string
Traceback (most recent call last):
   File "./rgb2pct", line 96, in ?
     print '%s has %d bands, need 3 for inputs red, green and blue.' \
TypeError: not enough arguments for format string
Traceback (most recent call last):
   File "./rgb2pct", line 96, in ?
.
.
.











More information about the mapserver-users mailing list