tiff conversion is creating much larger files

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
bds
Posts: 6
Joined: 2009-05-27T07:06:48-07:00
Authentication code: 8675309

tiff conversion is creating much larger files

Post by bds »

all -
thanks for reading and any suggestions or advice you may have.

i'm converting multiple tiffs with the following bit of hackery:
find ./ -name '*.tif' -exec convert -resample 250x250 -depth 8 {} ../new-tiffs/{} \;

the beginning file size is around 46 MB while the output files are 128 MB. any ideas as to what i'm doing wrong?
this is driving me crazy!

thanks again,
bds
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: tiff conversion is creating much larger files

Post by fmw42 »

possibly a change in (default) compression. see http://www.imagemagick.org/Usage/formats/#tiff

what IM version are you using. if old, then perhaps upgrade. Current version is IM 6.5.2-9

convert -list configure

will give you the full 4 level version number
bds
Posts: 6
Joined: 2009-05-27T07:06:48-07:00
Authentication code: 8675309

Re: tiff conversion is creating much larger files

Post by bds »

we have 6.2.8-? installed on the server. i'm going to ask about an upgrade.

there shouldn't be any compression on the original .tif, but i'll check. is there a specific part of the convert -identify output i should be looking for?

thanks very much.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: tiff conversion is creating much larger files

Post by fmw42 »

how about the line that says

compression ...
bds
Posts: 6
Joined: 2009-05-27T07:06:48-07:00
Authentication code: 8675309

Re: tiff conversion is creating much larger files

Post by bds »

Code: Select all

Compression: None
oops. also - this particular image group has a resolution of 400x400. is there any other info i can provide?

thanks again.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: tiff conversion is creating much larger files

Post by fmw42 »

what does

identify -verbose imagename

list for each image. I would have to see both. Or provide the two images.
bds
Posts: 6
Joined: 2009-05-27T07:06:48-07:00
Authentication code: 8675309

Re: tiff conversion is creating much larger files

Post by bds »

this is from the original file:

Code: Select all

Image: 0116_000050_000231_0002.tif
  Format: TIFF (Tagged Image File Format)
  Class: DirectClass
  Geometry: 3352x4348
  Type: TrueColor
  Endianess: MSB
  Colorspace: RGB
  Channel depth:
    Red: 8-bits
    Green: 8-bits
    Blue: 8-bits
  Channel statistics:
    Red:
      Min: 0 (0)
      Max: 253 (0.992157)
      Mean: 184.557 (0.723753)
      Standard deviation: 62.3311 (0.244436)
    Green:
      Min: 0 (0)
      Max: 253 (0.992157)
      Mean: 185.202 (0.726281)
      Standard deviation: 68.1179 (0.267129)
    Blue:
      Min: 0 (0)
      Max: 255 (1)
      Mean: 183.77 (0.720665)
      Standard deviation: 67.0929 (0.26311)
  Colors: 1242079
  Rendering intent: Undefined
  Resolution: 400x400
  Units: PixelsPerInch
  Filesize: 46mb
  Interlace: None
  Background color: white
  Border color: #DFDFDF
  Matte color: grey74
  Page geometry: 3352x4348+0+0
  Dispose: Undefined
  Iterations: 0
  Scene: 0 of 2
  Compression: None
  Orientation: TopLeft
  Make: Epson           
  Model: Exp10000XL      
  Signature: 557c32d4300fa7b3c9a599f7b99ff946c411634c024ad33651edf9a6002e1a83
  Software: SilverFast 6.4.3r9
  Timestamp: 2009:02:03 15:50:10
  Profile-icc: 544 bytes
0x00000000: 00022041 44424502 1000006d 6e747252 47422058  --- ADBE----mntrRGB 
0x00000190: 595a2007 d0000400 0a000a00 00000061 6373704d  XYZ ------------acsp
0x00000320: 53465400 0000006e 6f6e6500 00000000 00000000  MSFT----none--------
0x000004b0: 00000000 00000000 00f6d600 01000000 00d32d41  --------------------
0x00000640: 44424500 00000000 00000000 00000000 00000000  ADBE----------------
0x000007d0: 00000000 00000000 00000000 00000000 00000000  --------------------
0x00000960: 00000000 00000000 00000a63 70727400 0000fc00  ------------cprt----
0x00000af0: 00002464 65736300 00012000 00006c77 74707400  ---$desc--- ---lwtpt
0x00000c80: 00018c00 00001462 6b707400 0001a000 00001472  --------bkpt--------
0x00000e10: 54524300 0001b400 00000e67 54524300 0001c400  rTRC--------gTRC----
0x00000fa0: 00000e62 54524300 0001d400 00000e72 58595a00  ----bTRC--------rXYZ
0x00001130: 0001e400 00001467 58595a00 0001f800 00001462  --------gXYZ--------
0x000012c0: 58595a00 00020c00 00001474 65787400 00000028  bXYZ--------text----
0x00001450: 63292032 30303020 41646f62 65205379 7374656d  (c) 2000 Adobe Syste
0x000015e0: 7320496e 632e0064 65736300 00000000 00001141  ms Inc.-desc--------
0x00001770: 646f6265 20524742 20283139 39382900 00000000  Adobe RGB (1998)----
0x00001900: 00000000 00000000 00000000 00000000 00000000  --------------------
0x00001a90: 00000000 00000000 00000000 00000000 00000000  --------------------
0x00001c20: 00000000 00000000 00000000 00000000 00000000  --------------------
0x00001db0: 00000000 00000000 00000000 00000058 595a2000  ----------------XYZ 
0x00001f40: 00000000 00f35100 01000000 0116cc58 595a2000  -------Q--------XYZ 
0x000020d0: 00000000 00000000 00000000 00000063 75727600  ----------------curv
0x00002260: 00000000 00000102 33000063 75727600 00000000  ---------3--curv----
0x000023f0: 00000102 33000063 75727600 00000000 00000102  -----3--curv--------
0x00002580: 33000058 595a2000 00000000 009c1800 004fa500  -3--XYZ ----------O-
0x00002710: 0004fc58 595a2000 00000000 00348d00 00a02c00  ----XYZ ------4----,
0x000028a0: 000f9558 595a2000 00000000 00263100 00102f00  ----XYZ ------&1---/
0x00002a30: 00be9c6e                                      ----
  Tainted: False
  Version: ImageMagick 6.2.8 03/31/08 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html
Image: 0116_000050_000231_0002.tif
  Format: TIFF (Tagged Image File Format)
  Class: DirectClass
  Geometry: 1117x1449
  Type: TrueColor
  Endianess: MSB
  Colorspace: RGB
  Channel depth:
    Red: 8-bits
    Green: 8-bits
    Blue: 8-bits
  Channel statistics:
    Red:
      Min: 0 (0)
      Max: 253 (0.992157)
      Mean: 184.525 (0.723629)
      Standard deviation: 62.3612 (0.244554)
    Green:
      Min: 0 (0)
      Max: 253 (0.992157)
      Mean: 185.165 (0.726136)
      Standard deviation: 68.1607 (0.267297)
    Blue:
      Min: 0 (0)
      Max: 255 (1)
      Mean: 183.742 (0.720558)
      Standard deviation: 67.1252 (0.263236)
  Colors: 339996
  Rendering intent: Undefined
  Resolution: 72x72
  Units: PixelsPerInch
  Filesize: 46mb
  Interlace: None
  Background color: white
  Border color: #DFDFDF
  Matte color: grey74
  Page geometry: 1117x1449+0+0
  Dispose: Undefined
  Iterations: 0
  Scene: 1 of 2
  Compression: None
  Orientation: TopLeft
  Signature: 76ce62747b04ce43697df77a6b545b32789074acfbc26008583e45ea2350be1f
  Profile-icc: 544 bytes
0x00000000: 00022041 44424502 1000006d 6e747252 47422058  --- ADBE----mntrRGB 
0x00000190: 595a2007 d0000400 0a000a00 00000061 6373704d  XYZ ------------acsp
0x00000320: 53465400 0000006e 6f6e6500 00000000 00000000  MSFT----none--------
0x000004b0: 00000000 00000000 00f6d600 01000000 00d32d41  --------------------
0x00000640: 44424500 00000000 00000000 00000000 00000000  ADBE----------------
0x000007d0: 00000000 00000000 00000000 00000000 00000000  --------------------
0x00000960: 00000000 00000000 00000a63 70727400 0000fc00  ------------cprt----
0x00000af0: 00002464 65736300 00012000 00006c77 74707400  ---$desc--- ---lwtpt
0x00000c80: 00018c00 00001462 6b707400 0001a000 00001472  --------bkpt--------
0x00000e10: 54524300 0001b400 00000e67 54524300 0001c400  rTRC--------gTRC----
0x00000fa0: 00000e62 54524300 0001d400 00000e72 58595a00  ----bTRC--------rXYZ
0x00001130: 0001e400 00001467 58595a00 0001f800 00001462  --------gXYZ--------
0x000012c0: 58595a00 00020c00 00001474 65787400 00000028  bXYZ--------text----
0x00001450: 63292032 30303020 41646f62 65205379 7374656d  (c) 2000 Adobe Syste
0x000015e0: 7320496e 632e0064 65736300 00000000 00001141  ms Inc.-desc--------
0x00001770: 646f6265 20524742 20283139 39382900 00000000  Adobe RGB (1998)----
0x00001900: 00000000 00000000 00000000 00000000 00000000  --------------------
0x00001a90: 00000000 00000000 00000000 00000000 00000000  --------------------
0x00001c20: 00000000 00000000 00000000 00000000 00000000  --------------------
0x00001db0: 00000000 00000000 00000000 00000058 595a2000  ----------------XYZ 
0x00001f40: 00000000 00f35100 01000000 0116cc58 595a2000  -------Q--------XYZ 
0x000020d0: 00000000 00000000 00000000 00000063 75727600  ----------------curv
0x00002260: 00000000 00000102 33000063 75727600 00000000  ---------3--curv----
0x000023f0: 00000102 33000063 75727600 00000000 00000102  -----3--curv--------
0x00002580: 33000058 595a2000 00000000 009c1800 004fa500  -3--XYZ ----------O-
0x00002710: 0004fc58 595a2000 00000000 00348d00 00a02c00  ----XYZ ------4----,
0x000028a0: 000f9558 595a2000 00000000 00263100 00102f00  ----XYZ ------&1---/
0x00002a30: 00be9c48                                      ----
  Tainted: False
  User time: 5.820u
  Elapsed time: 0:07
  Pixels per second: 2.6e+02kb
  Version: ImageMagick 6.2.8 03/31/08 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html
identify: 0116_000050_000231_0002.tif: wrong data type 9 for "PlanarConfiguration"; tag ignored. `TIFFReadDirectory'.
and here is the output of identify -verbose for the output file:

Code: Select all

Image: 0116_000050_000231_0002.tif
  Format: TIFF (Tagged Image File Format)
  Class: DirectClass
  Geometry: 2095x2718
  Type: TrueColor
  Endianess: MSB
  Colorspace: RGB
  Channel depth:
    Red: 8-bits
    Green: 8-bits
    Blue: 8-bits
  Channel statistics:
    Red:
      Min: 0 (0)
      Max: 255 (1)
      Mean: 184.061 (0.721809)
      Standard deviation: 59.1371 (0.23191)
    Green:
      Min: 0 (0)
      Max: 255 (1)
      Mean: 184.709 (0.724349)
      Standard deviation: 64.7614 (0.253966)
    Blue:
      Min: 0 (0)
      Max: 255 (1)
      Mean: 183.275 (0.718726)
      Standard deviation: 64.058 (0.251208)
  Colors: 587507
  Rendering intent: Undefined
  Resolution: 250x250
  Units: PixelsPerInch
  Filesize: 1.3e+02mb
  Interlace: None
  Background color: white
  Border color: #DFDFDF
  Matte color: grey74
  Page geometry: 2095x2718+0+0
  Dispose: Undefined
  Iterations: 0
  Scene: 0 of 2
  Compression: None
  Orientation: TopLeft
  Document: /home/----/pdfs/231/new-tiffs-2/./0116_000050_000231_0002.tif
  Make: Epson           
  Model: Exp10000XL      
  Signature: 616500eb7bb73fb7b12159cbb599d0621968ed1b298bc0fb3ba777c47981139e
  Software: ImageMagick 6.2.8 03/31/08 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html
  Timestamp: 2009:02:03 15:50:10
  Profile-icc: 544 bytes
0x00000000: 00022041 44424502 1000006d 6e747252 47422058  --- ADBE----mntrRGB 
0x00000190: 595a2007 d0000400 0a000a00 00000061 6373704d  XYZ ------------acsp
0x00000320: 53465400 0000006e 6f6e6500 00000000 00000000  MSFT----none--------
0x000004b0: 00000000 00000000 00f6d600 01000000 00d32d41  --------------------
0x00000640: 44424500 00000000 00000000 00000000 00000000  ADBE----------------
0x000007d0: 00000000 00000000 00000000 00000000 00000000  --------------------
0x00000960: 00000000 00000000 00000a63 70727400 0000fc00  ------------cprt----
0x00000af0: 00002464 65736300 00012000 00006c77 74707400  ---$desc--- ---lwtpt
0x00000c80: 00018c00 00001462 6b707400 0001a000 00001472  --------bkpt--------
0x00000e10: 54524300 0001b400 00000e67 54524300 0001c400  rTRC--------gTRC----
0x00000fa0: 00000e62 54524300 0001d400 00000e72 58595a00  ----bTRC--------rXYZ
0x00001130: 0001e400 00001467 58595a00 0001f800 00001462  --------gXYZ--------
0x000012c0: 58595a00 00020c00 00001474 65787400 00000028  bXYZ--------text----
0x00001450: 63292032 30303020 41646f62 65205379 7374656d  (c) 2000 Adobe Syste
0x000015e0: 7320496e 632e0064 65736300 00000000 00001141  ms Inc.-desc--------
0x00001770: 646f6265 20524742 20283139 39382900 00000000  Adobe RGB (1998)----
0x00001900: 00000000 00000000 00000000 00000000 00000000  --------------------
0x00001a90: 00000000 00000000 00000000 00000000 00000000  --------------------
0x00001c20: 00000000 00000000 00000000 00000000 00000000  --------------------
0x00001db0: 00000000 00000000 00000000 00000058 595a2000  ----------------XYZ 
0x00001f40: 00000000 00f35100 01000000 0116cc58 595a2000  -------Q--------XYZ 
0x000020d0: 00000000 00000000 00000000 00000063 75727600  ----------------curv
0x00002260: 00000000 00000102 33000063 75727600 00000000  ---------3--curv----
0x000023f0: 00000102 33000063 75727600 00000000 00000102  -----3--curv--------
0x00002580: 33000058 595a2000 00000000 009c1800 004fa500  -3--XYZ ----------O-
0x00002710: 0004fc58 595a2000 00000000 00348d00 00a02c00  ----XYZ ------4----,
0x000028a0: 000f9558 595a2000 00000000 00263100 00102f00  ----XYZ ------&1---/
0x00002a30: 00be9c00                                      ----
  Tainted: False
  User time: 0.410u
  Elapsed time: 0:02
  Pixels per second: 5.4mb
  Version: ImageMagick 6.2.8 03/31/08 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html
identify seems to have gotten hung up on the second image. could it have something to do with the Document: file path? i'm not sure why it's going to a new-tiffs-2/./file name.

thanks again.
bds
Posts: 6
Joined: 2009-05-27T07:06:48-07:00
Authentication code: 8675309

Re: tiff conversion is creating much larger files

Post by bds »

this is output for the second image - it doesn't seem to include the tag information.

Code: Select all

Image: 0116_000050_000231_0002.tif
  Format: TIFF (Tagged Image File Format)
  Class: DirectClass
  Geometry: 2095x2718+0+0
  Resolution: 250x250
  Print size: 8.38x10.872
  Units: PixelsPerInch
  Type: TrueColor
  Base type: TrueColor
  Endianess: MSB
  Colorspace: RGB
  Depth: 8-bit
  Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
  Channel statistics:
    red:
      min: 0 (0)
      max: 255 (1)
      mean: 184.061 (0.721809)
      standard deviation: 59.1371 (0.23191)
      kurtosis: 0.188017
      skewness: -1.34815
    green:
      min: 0 (0)
      max: 255 (1)
      mean: 184.709 (0.724349)
      standard deviation: 64.7614 (0.253966)
      kurtosis: -0.20757
      skewness: -1.24257
    blue:
      min: 0 (0)
      max: 255 (1)
      mean: 183.275 (0.718726)
      standard deviation: 64.058 (0.251208)
      kurtosis: -0.0639397
      skewness: -1.28979
  Image statistics:
    OverAll:
      min: 0 (0)
      max: 255 (1)
      mean: 138.011 (0.541221)
      standard deviation: 96.426 (0.378141)
      kurtosis: -1.58933
      skewness: -0.463975
  Rendering intent: Undefined
  Interlace: None
  Background color: white
  Border color: rgb(223,223,223)
  Matte color: grey74
  Transparent color: black
  Page geometry: 2095x2718+0+0
  Dispose: Undefined
  Iterations: 0
  Scene: 0 of 2
  Compression: None
  Orientation: TopLeft
  Properties:
    create-date: 2009-05-28T08:51:46-04:00
    modify-date: 2009-05-28T08:51:46-04:00
    signature: b4f596fbeb9050f1c8b9386b2e59c75c0a12d7dde49540770c3fdbae95f866ac
    tiff:document: /home/dladmin/pdfs/231/new-tiffs-2/./0116_000050_000231_0002.tif
    tiff:make: Epson           
    tiff:model: Exp10000XL      
    tiff:rows-per-strip: 1
    tiff:software: ImageMagick 6.2.8 03/31/08 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html
    tiff:timestamp: 2009:02:03 15:50:10
  Profiles:
    Profile-icc: 544 bytes
  Artifacts:
    verbose: true
  Tainted: False
  Filesize: 128mb
  Number pixels: 5.43mb
  Pixels per second: 927kb
  User time: 1.630u
  Elapsed time: 0:07
  Version: ImageMagick 6.5.2-9 2009-05-27 Q8 http://www.imagemagick.org
Image: 0116_000050_000231_0002.tif
  Format: TIFF (Tagged Image File Format)
  Class: DirectClass
  Geometry: 3878x5031+0+0
  Resolution: 250x250
  Print size: 15.512x20.124
  Units: PixelsPerInch
  Type: TrueColor
  Base type: TrueColor
  Endianess: MSB
  Colorspace: RGB
  Depth: 16/8-bit
  Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
  Channel statistics:
    red:
      min: 0 (0)
      max: 254 (0.996078)
      mean: 184.527 (0.723634)
      standard deviation: 59.8581 (0.234738)
      kurtosis: 0.166514
      skewness: -1.30208
    green:
      min: 0 (0)
      max: 254 (0.996078)
      mean: 185.168 (0.726151)
      standard deviation: 65.6578 (0.257482)
      kurtosis: -0.0898499
      skewness: -1.2448
    blue:
      min: 0 (0)
      max: 255 (1)
      mean: 183.744 (0.720566)
      standard deviation: 64.6934 (0.2537)
      kurtosis: -0.0237595
      skewness: -1.25552
  Image statistics:
    OverAll:
      min: 0 (0)
      max: 255 (1)
      mean: 138.36 (0.542588)
      standard deviation: 96.9598 (0.380234)
      kurtosis: -1.58035
      skewness: -0.453721
  Rendering intent: Undefined
  Interlace: None
  Background color: white
  Border color: rgb(223,223,223)
  Matte color: grey74
  Transparent color: black
  Page geometry: 3878x5031+0+0
  Dispose: Undefined
  Iterations: 0
  Scene: 1 of 2
  Compression: None
  Orientation: TopLeft
  Properties:
    create-date: 2009-05-28T08:51:46-04:00
    modify-date: 2009-05-28T08:51:46-04:00
    signature: ff00e61e1905d9c128df2a9e69b6c2512fd010a619cba46bc247d944401190de
    tiff:document: /home/----/pdfs/231/new-tiffs-2/./0116_000050_000231_0002.tif
    tiff:rows-per-strip: 1
    tiff:software: ImageMagick 6.2.8 03/31/08 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html
  Profiles:
    Profile-icc: 544 bytes
  Artifacts:
    verbose: true
  Tainted: False
  Filesize: 128mb
  Number pixels: 18.61mb
  Pixels per second: 2.067mb
  User time: 5.070u
  Elapsed time: 0:10
  Version: ImageMagick 6.5.2-9 2009-05-27 Q8 http://www.imagemagick.org
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: tiff conversion is creating much larger files

Post by fmw42 »

First, you are using resample to both change the resolution AND image size. Is that what you want? What are you trying to do with -resample?

see
http://www.imagemagick.org/script/comma ... p#resample
vs
http://www.imagemagick.org/script/comma ... hp#density
vs
http://www.imagemagick.org/script/comma ... php#resize


original image - frame/page 0
Geometry: 3352x4348
Resolution: 400x400
Page geometry: 3352x4348+0+0

original image - frame/page 1
Geometry: 1117x1449
Resolution: 72x72
Page geometry: 1117x1449+0+0


output image - frame/page 0
Geometry: 2095x2718+0+0
Resolution: 250x250
Depth: 8-bit
Page geometry: 2095x2718+0+0


output image - frame/page 1
Geometry: 3878x5031+0+0
Resolution: 250x250
Depth: 16/8-bit
Page geometry: 3878x5031+0+0

Thus the first frame gets smaller in pixels and the second one gets much bigger in pixels. Thus the difference in file sizes.

If you just want to change resolution and not change the pixel dimensions (file size), then use -density rather than -resample.
bds
Posts: 6
Joined: 2009-05-27T07:06:48-07:00
Authentication code: 8675309

Re: tiff conversion is creating much larger files

Post by bds »

fmw42 --
thanks for your help. i looked through the IM command-line options list when i was originally setting up my processing and i did the opposite (obviously, perhaps) of what you've suggested. i'll give it a try though.

my original plan was to keep the images at the same size and only lower the resolution to keep the file size down, so the tiffs could in turn be used to create pdfs. file size may be where i'm getting confused.

the strange thing is that the original processing (using -resample) has worked fine for other image batches - there have only been a few where IM created these over-sized files.

thanks again.
bds

[edited b/c i'm forgetful]
Post Reply