Trouble converting a Tiff

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
jettman

Trouble converting a Tiff

Post by jettman »

Hi,

I am trying to convert a tiff to a jpg and png. I receive two errors/warnings when I execute a convert command on the image in question.

convert Amb_A7_9A_L2_25.tif Amb_A7_9A_L2.jpg

convert: Amb_A7_9A_L2_25.tif: unknown field with tag 37724 (0x935c) encountered. `TIFFReadDirectory' @ tiff.c/TIFFWarnings/526.

convert: Compression algorithm does not support random access. `Amb_A7_9A_L2_25.tif' @ tiff.c/TIFFErrors/324.

Neither a jpg or png is successfully generated with the original image. However these errors go away if I open the original in photoshop, save as a tiff removing the layers and using NO compression. (The original uses LZW) After these changes to the original the jpg is successfully generated but the png is not (I suspect this may be due to a CMYK/RGB shift).

Can I convert this original tiff into a png and jpg using IM?

The original file is located here.
http://www.yousendit.com/download/dVlxY ... V3gzZUE9PQ

My version of IM:
Version: ImageMagick 6.5.1-8 2009-04-26 Q16 OpenMP http://www.imagemagick.org

Any help is appreciated.
Thanks
Tom
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Trouble converting a Tiff

Post by magick »

The problem you reported is fixed in the latest ImageMagick release, 6.5.2-1.
jettman

Re: Trouble converting a Tiff

Post by jettman »

I downloaded the latest IM today and tried again but I still have the same issues. Am I missing something here.


convert Amb_A7_9A_L2_25.tif Amb_A7_9A_L2_25.jpg

convert: Amb_A7_9A_L2_25.tif: unknown field with tag 37724 (0x935c) encountered. `TIFFReadDirectory' @ tiff.c/TIFFWarnings/525.
convert: Compression algorithm does not support random access. `Amb_A7_9A_L2_25. tif' @ tiff.c/TIFFErrors/323.

convert -version

Version: ImageMagick 6.5.2-0 2009-05-01 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Trouble converting a Tiff

Post by magick »

Version: ImageMagick 6.5.2-0 2009-05-01 Q16 OpenMP http://www.imagemagick.org
You need 6.5.2-1.
jettman

Re: Trouble converting a Tiff

Post by jettman »

That did fix the "random access" error and it now generates the jpg image. However the resulting png is still not correct. The resulting png only has a black square on a white or transparent background. Is there some color correction that is required to make the conversion?

Version: ImageMagick 6.5.2-2 2009-05-05 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC

Thanks
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Trouble converting a Tiff

Post by magick »

Try this command:
  • convert Amb_A7_9A_L2_25.tif -colorspace rgb +matte Amb_A7_9A_L2.png
You have a fifth channel that ImageMagick is interpretting as an alpha / matte channel which is predominately transparent.
carden

Re: Trouble converting a Tiff

Post by carden »

It seems I've got the similat problem with my TIFF, which was saved by PS CS3 with compression LZW and Pixel Order - per Channel.
ATM I'm using "ImageMagick 6.5.7-0 2009-10-15 Q16 OpenMP", but "Compression algorithm does not support random access" error isn't disappeared.

Here is "identify -verbose" command log for it:

Code: Select all

Image: E:\TestData\TIFFs\WE16_HK1T_0288_02X_D_001.tif
  Format: TIFF (Tagged Image File Format)
  Class: DirectClass
  Geometry: 4000x3071+0+0
  Resolution: 300x300
  Print size: 13.3333x10.2367
  Units: PixelsPerInch
  Type: ColorSeparation
  Base type: ColorSeparation
  Endianess: MSB
  Colorspace: CMYK
  Depth: 8-bit
  Channel depth:
    cyan: 8-bit
    magenta: 8-bit
    yellow: 8-bit
    black: 8-bit
  Channel statistics:
    cyan:
      min: 0 (0)
      max: 255 (1)
      mean: 1.14853 (0.00450403)
      standard deviation: 13.1028 (0.0513836)
      kurtosis: 206.55
      skewness: 13.8585
    magenta:
      min: 0 (0)
      max: 255 (1)
      mean: 1.40847 (0.0055234)
      standard deviation: 14.0488 (0.0550934)
      kurtosis: 141.417
      skewness: 11.492
    yellow:
      min: 0 (0)
      max: 255 (1)
      mean: 2.10764 (0.00826526)
      standard deviation: 18.6173 (0.0730089)
      kurtosis: 93.0889
      skewness: 9.48966
    black:
      min: 0 (0)
      max: 248 (0.972549)
      mean: 0.721727 (0.0028303)
      standard deviation: 10.9702 (0.0430205)
      kurtosis: 303.67
      skewness: 17.1071
  Image statistics:
    Overall:
      min: 0 (0)
      max: 255 (1)
      mean: 1.07727 (0.0042246)
      standard deviation: 12.9496 (0.0507829)
      kurtosis: 196.574
      skewness: 13.6341
  Total ink density: 389%
  Rendering intent: Undefined
  Interlace: None
  Background color: white
  Border color: cmyk(223,223,223,0)
  Matte color: grey74
  Transparent color: black
  Compose: Over
  Page geometry: 4000x3071+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: LZW
  Orientation: TopLeft
  Properties:
    date:create: 2009-10-19T11:32:25+03:00
    date:modify: 2009-10-19T11:32:26+03:00
    dc:format: image/tiff
    exif:ColorSpace: -1
    exif:NativeDigest: 36864,40960,40961,37121,37122,40962,40963,37510,40964,36867,36868,33434,33437,34850,34852,34855,3
4856,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37396,41483,41484,41486,41487,41488,41492,41493,41495,4
1728,41729,41730,41985,41986,41987,41988,41989,41990,41991,41992,41993,41994,41995,41996,42016,0,2,4,5,6,7,8,9,10,11,12,
13,14,15,16,17,18,20,22,23,24,25,26,27,28,30;D6FCFA3D8EF86FDE97C8297DA63F7DC9
    exif:PixelXDimension: 4000
    exif:PixelYDimension: 3071
    photoshop:ColorMode: 4
    photoshop:History:
    signature: eee9e77e7fb1816646f9d6e4a62c6e26814566424ef13c3463c66265da59357e
    stRef:documentID: uuid:B6CBE790AF5211DE9C37DC434F6A0575
    stRef:instanceID: uuid:B6CBE791AF5211DE9C37DC434F6A0575
    tiff:Compression: 5
    tiff:ImageLength: 3071
    tiff:ImageWidth: 4000
    tiff:NativeDigest: 256,257,258,259,262,274,277,284,530,531,282,283,296,301,318,319,529,532,306,270,271,272,305,315,3
3432;B266D2A17943907DF5A328E6F80C7CE9
    tiff:photometric: separated
    tiff:PhotometricInterpretation: 5
    tiff:PlanarConfiguration: 2
    tiff:rows-per-strip: 65
    tiff:SamplesPerPixel: 4
    tiff:software: Adobe Photoshop CS3 Windows
    tiff:timestamp: 2009:10:19 11:32:04
    xap:CreateDate: 2009-10-19T11:32:04+03:00
    xap:CreatorTool: Adobe Photoshop CS3 Windows
    xap:MetadataDate: 2009-10-19T11:32:04+03:00
    xap:ModifyDate: 2009-10-19T11:32:04+03:00
    xapMM:DocumentID: uuid:25D7B20A89BCDE118A749C8EC9D996BC
    xapMM:InstanceID: uuid:26D7B20A89BCDE118A749C8EC9D996BC
  Clipping path:
<?xml version="1.0" encoding="iso-8859-1"?>
<svg width="4000" height="3071">
<g>
<path style="fill:#00000000;stroke:#00000000;stroke-width:0;stroke-antialiasing:false" d="
M 740,677.5
L 992.5,669
C 1129.5,665 1443.5,652.5 1571.5,646.5
C 1699.5,640.5 1926,630.5 1926,630.5
L 2183,618.5
L 2492,605
C 2535.5,602.5 2747.5,595.5 2747.5,595.5
L 2855,592
C 2855,592 2877.5,594 2884.5,598
C 2979.5,638 3209,741.5 3232,750.5
C 3256,763 3312.5,789 3352,891
C 3383.5,978 3397.5,1043.5 3405.5,1121.5
C 3412,1192 3414,1257 3410.5,1316
C 3406.5,1370.5 3401,1431 3372.5,1493
C 3344,1555 3313,1587.5 3249,1591
C 3209,1595 3186.5,1597 3182.5,1589.5
C 3168.5,1584.5 3138.5,1590 3138.5,1590
C 3128.5,1610.5 3099.5,1628.5 3099.5,1628.5
C 3099.5,1628.5 3107,1692 3096,1708.5
C 3147.5,1712.5 3187,1715 3176.5,1736.5
C 3166,1758 3076.5,1772 3008.5,1771.5
C 2940.5,1771 2807.5,1755 2841,1718
C 2874,1693 2913.5,1694 2913.5,1694
C 2913.5,1694 2913.5,1687 2916,1682.5
C 2917,1632 2916,1628 2916,1628
C 2894.5,1611 2885,1603.5 2885,1603.5
C 2818,1608.5 2764.5,1611.5 2764.5,1611.5
C 2756,1630 2754.5,1643.5 2730.5,1644
C 2704,1645.5 2453,1662 2453,1662
C 2453,1662 2438.5,1702.5 2327,1703
C 2242.5,1701.5 2210,1675.5 2210,1675.5
L 2056.5,1682
L 1751,1701.5
L 1456,1720
L 1209,1735
L 1194.5,1747
C 1196,1796.5 1197,1813 1197,1813
C 1197,1813 1314,1829 1270.5,1862
C 1222.5,1886 1146,1902 1027,1890.5
C 937.5,1881.5 907,1870 936.5,1844
C 967.5,1828 1003,1826 1003,1826
L 1004,1754
C 1004,1754 972.5,1737 970.5,1727
C 945,1731 916.5,1727.5 916.5,1727.5
C 845,1732.5 811,1748 778,1705.5
C 748,1649 695.5,1520.5 657,1462.5
C 627.5,1413.5 620,1409 605.5,1291
C 598.5,1213 595.5,1163.5 594,1051.5
C 592,947 594,863.5 599,788.5
C 606,736.5 610.5,687.5 648.5,681
C 688,677 740,677.5 740,677.5 Z
M 270,1582
C 270,1582 320,1477 452.5,1472
C 538.5,1478 635.5,1505.5 632.5,1590
C 628.5,1635 609.5,1663 609.5,1663
C 628,1669.5 642.5,1667.5 671,1699.5
C 776,1793 946,1938.5 946,1938.5
C 983,1970 1005.5,1984 990.5,2003
C 975.5,2022 938.5,2033 938.5,2033
C 937,2073 934,2108 868,2121.5
C 802,2135 582,2158 563.5,2158
C 450.5,2170 187.5,2191 187.5,2191
L 2.50006,2211
L 1.49989,1688
L 205,1671
L 208,1665
C 215.5,1625.5 230.5,1600 270,1582 Z
M 3862.5,1690
C 3884.5,1694.5 3927,1704.5 3932,1707
C 3939,1710 3946.5,1712 3948,1714.5
C 3974,1745 3999.5,1777 3999.5,1777
L 3998,1859
C 3998,1859 3954,1869 3933,1867.5
C 3910.5,1885 3899,1894.5 3899,1894.5
C 3899,1894.5 3923.5,1916.5 3921,1922
C 3918.5,1927.5 3878.5,1973.5 3785,2000
C 3726.5,2012.5 3666.5,1997 3638,1961
C 3635,1957.5 3633.5,1951.5 3639.5,1932.5
C 3637,1927.5 3629,1926.5 3629,1926.5
C 3629,1926.5 3640.5,1955 3618.5,1978
C 3601.5,2000.5 3596,2010 3541.5,1996.5
C 3512,1990 3515,1983.5 3517.5,1976.5
C 3494.5,1978 3477,1978.5 3471,1970.5
C 3464.5,1984 3464,1990.5 3464,1990.5
C 3464.5,2008.5 3453.5,2021 3437.5,2022.5
C 3399,2035 3372,2037 3326,2038
C 3277,2039.5 3246,2039 3236.5,2032
C 3226,2025.5 3214,2031.5 3214,2031.5
C 3201.5,2036.5 3188,2040.5 3192.5,2021.5
C 3198.5,2007.5 3213,1987 3218.5,1977
C 3228.5,1961 3250.5,1926.5 3275.5,1919.5
C 3250.5,1897 3172.5,1847 3190,1808
C 3207.5,1776 3223.5,1766.5 3231.5,1765.5
C 3235.5,1759 3233.5,1753.5 3245,1757
C 3286,1757 3309.5,1757 3309.5,1757
C 3309.5,1757 3293.5,1736.5 3314,1726
C 3335.5,1699 3367.5,1650.5 3418,1666
C 3421,1634.5 3423,1577 3506.5,1510
C 3502.5,1489 3516.5,1473 3531,1490
C 3560,1478.5 3615.5,1468.5 3670,1482.5
C 3663,1474.5 3656,1472 3656,1472
C 3653.5,1470.5 3642,1463.5 3645.5,1461.5
C 3649.5,1459.5 3655.5,1467.5 3660,1470.5
C 3669.5,1476 3677,1482 3677.5,1486
C 3700,1494 3755.5,1511 3803.5,1604.5
C 3819.5,1642 3823.5,1681.5 3819,1717
C 3837,1694.5 3852,1683 3852,1683
C 3852,1683 3859,1686 3862.5,1690 Z
M 3514.5,1502
C 3514.5,1502 3506,1479 3528.5,1490
C 3519,1496 3514.5,1502 3514.5,1502 Z
M 3364.41,1754.66
C 3371.18,1751.05 3388.78,1744.28 3388.78,1744.28
C 3400.52,1742.48 3419.93,1739.32 3427.6,1745.64
C 3432.12,1751.96 3433.92,1760.08 3433.92,1760.08
C 3385.62,1758.73 3363.5,1757.37 3363.5,1757.37
"/>
</g>
</svg>

  Profiles:
    Profile-8bim: 21316 bytes
    Profile-iptc: 8 bytes
      unknown[2,0]:
    Profile-xmp: 15571 bytes
  Artifacts:
    verbose: true
  Tainted: False
  Filesize: 19.75MiB
  Number pixels: 11.71MiB
  Pixels per second: 150.2MiB
  User time: 0.078u
  Elapsed time: 0:01.077
  Version: ImageMagick 6.5.7-0 2009-10-15 Q16 OpenMP http://www.imagemagick.org
identify: Compression algorithm does not support random access. `E:\TestData\TIFFs\WE16_HK1T_0288_02X_D_001.tif' @ tiff.
c/TIFFErrors/493.
You can download the image example here: http://dc104.2shared.com/download/85303 ... 0-364e1741
Your help will be very much appreciated. TIA.
Post Reply