Clipping Path Name property name disappears in converted TIFF file

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
Prasad520
Posts: 9
Joined: 2016-05-13T00:35:34-07:00
Authentication code: 1151

Clipping Path Name property name disappears in converted TIFF file

Post by Prasad520 »

Hello All

I'm new at using IM and have a scenario which I got stuck.

I need to convert images ( from any format ) to TIFF.I m using below IM command

"convert -units PixelsPerInch -auto-orient -intent Perceptual -black-point-compensation [SourceFile] -resample [Dpi] -resize 2480x -resize x2480> -crop 2480x2480+0+0 +repage -strip [OutputFile]"

After conversion, in the output file, the clipping path name property gets disappeared.

When I remove “-strip” switch from above command, clipping path name property is included in the converted output TIFF file but image is broken when trying to preview in PS.

Can anyone help me to sort/suggest an approach, how to include the clipping name property in the output TIFF file without breaking image in PS.

Earlier I posted the same in IM/Users section ( viewtopic.php?f=1&t=29679&p=133232&sid= ... 20#p133232 )
and from their suggestions, I m reposting here ( Developer section ) and please suggest some solution that to overcome this issue.

IM Version: ImageMagick 6.8.8-6 Q16 x86_64 2014-02-17

Thanks
Prasad520
Posts: 9
Joined: 2016-05-13T00:35:34-07:00
Authentication code: 1151

Re: Clipping Path Name property name disappears in converted TIFF file

Post by Prasad520 »

Hi,

Any suggestions here plz..

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

Re: Clipping Path Name property name disappears in converted TIFF file

Post by snibgo »

I'm not a developer, and I don't use Photoshop, but your problem is not well-defined.
Prasad520 wrote:... but image is broken when trying to preview in PS.
What is wrong with it? Does PS fail to read the file?
Prasad520 wrote:"convert -units PixelsPerInch -auto-orient -intent Perceptual -black-point-compensation [SourceFile] -resample [Dpi] -resize 2480x -resize x2480> -crop 2480x2480+0+0 +repage -strip [OutputFile]"
What is the minimum command that causes the problem?

You command is in the wrong order. "-auto-orient" is an operation, so should occur after the input fle is read.

Does the problem occur on all inputs, or just inputs that are automatically rotated, or what?

A sample input file, and output from PS, might help.
snibgo's IM pages: im.snibgo.com
Prasad520
Posts: 9
Joined: 2016-05-13T00:35:34-07:00
Authentication code: 1151

Re: Clipping Path Name property name disappears in converted TIFF file

Post by Prasad520 »

Hi,

Thanks for your reply

The minimum command which reproduces the issue is

Scenario 1 [Using Strip Switch]:
========

Code: Select all

convert [SourceFile] -strip [OutputFile.tiff]
which strips all metadata including clipping path name from source file. To check it, I ran below exiftool command [ if Photoshop is not available ]

Code: Select all

exiftool -a -s [OutputFIle.tiff] |grep Path
which gives me an empty result. But Photoshop can read and preview the file [ Please see below sample screenshot ]

https://www.dropbox.com/s/rzwfq09zosnlk ... h.png?dl=0

Scenario 2 [Without Using Strip Switch]:
========

Code: Select all

convert [SourceFile]  [OutputFile.tiff]
which has all metadata including clipping path name in the outputfile. But problem is PS cannot read the file, Image is broken.[ Please see below sample screenshot ]

https://www.dropbox.com/s/y7li42qbs17i1 ... h.png?dl=0

I have tried with tif and jpeg format input files.

Sample Input File: https://www.dropbox.com/s/mri9ciyyhvljv ... e.tif?dl=0

OutputFile When Using Strip Switch: https://www.dropbox.com/s/gs61ckst2je0d ... .tiff?dl=0

OutputFile without Using Strip Switch: https://www.dropbox.com/s/hu8itjt8dka7z ... .tiff?dl=0

Please let me know if you need any other information.

Thanks for your help in advance.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Clipping Path Name property name disappears in converted TIFF file

Post by fmw42 »

Please post a real source file not screen shot that converts to tif but cannot be opened in PS. Also what is your IM version and platform.
Prasad520
Posts: 9
Joined: 2016-05-13T00:35:34-07:00
Authentication code: 1151

Re: Clipping Path Name property name disappears in converted TIFF file

Post by Prasad520 »

Hi,

Thanks for the follow up.

IM Version: ImageMagick 6.8.8-6 Q16 x86_64 2014-02-17
Platform: OS X 10.9.4
Please post a real source file
If you are talking about converted output files then please refer below dropbox location

https://www.dropbox.com/s/gs61ckst2je0d ... .tiff?dl=0 which CAN open in Photoshop but no clipping path name property in converted output file [ command ran: convert [SourceFile] -strip [OutputFile.tiff] ]

https://www.dropbox.com/s/hu8itjt8dka7z ... .tiff?dl=0 which CANNOT open in Photoshop but clipping path name property exists. [ command ran: convert [SourceFile] [OutputFile.tiff] ]

Source file loc: https://www.dropbox.com/s/mri9ciyyhvljv ... e.tif?dl=0

Hope your queries are cleared. Please let me know if you need any further details.

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

Re: Clipping Path Name property name disappears in converted TIFF file

Post by fmw42 »

Sorry, I have tried everything I know and still get your same error message even for a simple convert. I think there is something strange in one of your profiles that contain PS specific data. However, this round-about method does work. It gets the clip path first and pipes it to the convert command which first removes the profiles and then adds the transparency back from the clip path and re-adds your CMYK profile.

Code: Select all

identify -quiet -format "%[8BIM:1999,2998:#1]" test_input_file.tif  |\
convert -quiet test_input_file.tif +profile "*" \( - -negate \) \
-alpha off -compose copy_opacity -composite \
-define tiff:alpha=associated \
-profile /Users/fred/images/profiles/ISOcoated_v2_300_eci.icc \
result.tif
Note if you are going to be doing resizing (-resample, -resize), I would recommend that you convert to sRGB (via profiles) before the resizing.
Prasad520
Posts: 9
Joined: 2016-05-13T00:35:34-07:00
Authentication code: 1151

Re: Clipping Path Name property name disappears in converted TIFF file

Post by Prasad520 »

Hi Fred,

Thanks for your suggestion.

I have tried the above suggested way but still I m facing some issues. I have ran the below command

Code: Select all

identify -quiet -format "%[8BIM:1999,2998:#1]" /users/prasad/E/test/test_input_file.tif convert -quiet /users/prasad/E/test/test_input_file.tif +profile "*" -negate -alpha off -compose copy_opacity -composite -define tiff:alpha=associated -profile /users/prasad/E/profiles/Generic-CMYK-Profile.icc /users/prasad/E/test/test_results/result.tiff
Below is the output I have got
identify: unable to open image `convert': No such file or directory @ error/blob.c/OpenBlob/2643.
identify: no decode delegate for this image format `convert' @ error/constitute.c/ReadImage/555.
identify: unrecognized option `+profile' @ error/identify.c/IdentifyImageCommand/784.
<?xml version="1.0" encoding="iso-8859-1"?>
<svg width="2330" height="4003">
<g>
<path style="fill:#00000000;stroke:#00000000;stroke-width:0;stroke-antialiasing:false" d="
M 1696.13 3908.12
C 1723.55 3908.61 1832.31 3911.42 1858.12 3910.97
C 1883.93 3910.52 1901.52 3909.32 1932.12 3891.95
C 1962.71 3874.59 2064.57 3813.67 2109.1 3785.45
C 2153.63 3757.24 2194.7 3730.56 2201.1 3724.6
C 2207.49 3718.63 2217.03 3702.05 2219.09 3631.41
C 2221.16 3560.76 2219.04 3245.03 2219.09 3193.05
C 2219.15 3141.06 2217.84 3030.27 2218.09 2994.31
C 2218.35 2958.35 2217.05 2805.48 2217.09 2766.1
C 2217.14 2726.71 2215.45 2566.19 2216.09 2496.99
C 2216.74 2427.8 2215.46 2309.36 2215.09 2262.12
C 2214.73 2214.89 2211.1 2076.56 2209.09 2032.01
C 2207.09 1987.45 2205.6 1971.17 2196.1 1905.54
C 2186.59 1839.9 2169.36 1733.68 2162.1 1685.88
C 2154.84 1638.08 2129.98 1505.16 2120.1 1448.16
C 2110.22 1391.15 2082.55 1208.07 2079.1 1187.61
C 2075.65 1167.16 2063.84 1088.63 2061.11 1051.64
C 2058.37 1014.64 2050.67 867.318 2051.11 819.617
Y 2051.54 771.917 2051.11 640.85
V 1898.36 633.322 1845.12 633.242
C 1791.88 633.163 1693.99 636.305 1660.14 640.85
Y 1626.28 645.394 1611.14 646.555
V 1608.08 573.3 1608.14 557.171
C 1607.39 550.598 1608.5 551.712 1603.14 543.859
C 1597.78 536.005 1568.18 494.9 1548.14 467.787
C 1528.11 440.674 1503.28 408.979 1497.15 399.323
C 1491.02 389.667 1492.31 390.195 1486.15 389.814
C 1479.99 389.433 1368.84 385.452 1322.16 385.059
C 1275.49 384.667 1193.76 386.396 1153.17 386.961
C 1112.58 387.527 998.783 386.629 956.188 387.912
C 913.593 389.195 913.316 387.548 908.192 394.569
C 903.067 401.588 821.082 523.623 811.199 537.202
C 801.316 550.782 796.352 552.432 795.2 589.502
Y 794.048 626.57 793.2 657.015
V 773.938 658.865 718.206 656.064
C 662.473 653.263 641.22 650.076 598.215 650.359
C 555.209 650.641 449.136 656.71 423.228 657.966
Y 397.32 659.221 350.233 663.671
V 354.999 847.417 355.233 883.327
C 355.466 919.238 358.497 970.966 357.232 1005.04
C 355.968 1039.12 330.852 1197.42 323.235 1231.35
C 315.618 1265.29 266.755 1500.49 246.241 1600.3
C 225.726 1700.11 178.703 1925.66 156.247 2046.27
C 133.792 2166.88 126.67 2194.32 126.25 2293.5
C 125.829 2392.68 123.566 3267.83 123.25 3368.96
C 122.933 3470.09 122.671 3712.16 124.25 3763.58
C 125.829 3815 120.572 3824.74 132.249 3841.56
C 143.926 3858.37 161.684 3858.97 175.246 3858.67
C 188.808 3858.37 210.734 3856.9 235.242 3858.67
C 259.75 3860.44 600.702 3873.6 687.208 3877.69
C 773.714 3881.78 1079.22 3891.34 1323.16 3898.61
C 1567.1 3905.87 1668.71 3907.63 1696.13 3908.12 Z
M 910.191 630.39
C 909.694 614.267 906.086 560.891 909.191 556.22
C 912.297 551.55 917.883 551.794 929.19 551.466
C 940.497 551.137 1078.75 548.313 1137.17 547.662
C 1195.59 547.011 1292.63 547.075 1342.16 547.662
C 1391.69 548.249 1468.03 550.305 1477.15 550.515
Y 1486.27 550.725 1487.15 552.416
V 1488.29 575.464 1488.15 589.502
C 1488 603.539 1488.73 645.672 1488.15 647.506
C 1487.57 649.34 1375.36 649.727 1353.16 650.359
C 1330.95 650.99 1018.11 655.11 993.185 655.113
Y 968.262 655.116 913.191 657.015
V 910.689 646.512 910.191 630.39 Z
"/>
</g>
</svg>
<?xml version="1.0" encoding="iso-8859-1"?>
<svg width="2330" height="4003">
<g>
<path style="fill:#00000000;stroke:#00000000;stroke-width:0;stroke-antialiasing:false" d="
M 1696.13 3908.12
C 1723.55 3908.61 1832.31 3911.42 1858.12 3910.97
C 1883.93 3910.52 1901.52 3909.32 1932.12 3891.95
C 1962.71 3874.59 2064.57 3813.67 2109.1 3785.45
C 2153.63 3757.24 2194.7 3730.56 2201.1 3724.6
C 2207.49 3718.63 2217.03 3702.05 2219.09 3631.41
C 2221.16 3560.76 2219.04 3245.03 2219.09 3193.05
C 2219.15 3141.06 2217.84 3030.27 2218.09 2994.31
C 2218.35 2958.35 2217.05 2805.48 2217.09 2766.1
C 2217.14 2726.71 2215.45 2566.19 2216.09 2496.99
C 2216.74 2427.8 2215.46 2309.36 2215.09 2262.12
C 2214.73 2214.89 2211.1 2076.56 2209.09 2032.01
C 2207.09 1987.45 2205.6 1971.17 2196.1 1905.54
C 2186.59 1839.9 2169.36 1733.68 2162.1 1685.88
C 2154.84 1638.08 2129.98 1505.16 2120.1 1448.16
C 2110.22 1391.15 2082.55 1208.07 2079.1 1187.61
C 2075.65 1167.16 2063.84 1088.63 2061.11 1051.64
C 2058.37 1014.64 2050.67 867.318 2051.11 819.617
Y 2051.54 771.917 2051.11 640.85
V 1898.36 633.322 1845.12 633.242
C 1791.88 633.163 1693.99 636.305 1660.14 640.85
Y 1626.28 645.394 1611.14 646.555
V 1608.08 573.3 1608.14 557.171
C 1607.39 550.598 1608.5 551.712 1603.14 543.859
C 1597.78 536.005 1568.18 494.9 1548.14 467.787
C 1528.11 440.674 1503.28 408.979 1497.15 399.323
C 1491.02 389.667 1492.31 390.195 1486.15 389.814
C 1479.99 389.433 1368.84 385.452 1322.16 385.059
C 1275.49 384.667 1193.76 386.396 1153.17 386.961
C 1112.58 387.527 998.783 386.629 956.188 387.912
C 913.593 389.195 913.316 387.548 908.192 394.569
C 903.067 401.588 821.082 523.623 811.199 537.202
C 801.316 550.782 796.352 552.432 795.2 589.502
Y 794.048 626.57 793.2 657.015
V 773.938 658.865 718.206 656.064
C 662.473 653.263 641.22 650.076 598.215 650.359
C 555.209 650.641 449.136 656.71 423.228 657.966
Y 397.32 659.221 350.233 663.671
V 354.999 847.417 355.233 883.327
C 355.466 919.238 358.497 970.966 357.232 1005.04
C 355.968 1039.12 330.852 1197.42 323.235 1231.35
C 315.618 1265.29 266.755 1500.49 246.241 1600.3
C 225.726 1700.11 178.703 1925.66 156.247 2046.27
C 133.792 2166.88 126.67 2194.32 126.25 2293.5
C 125.829 2392.68 123.566 3267.83 123.25 3368.96
C 122.933 3470.09 122.671 3712.16 124.25 3763.58
C 125.829 3815 120.572 3824.74 132.249 3841.56
C 143.926 3858.37 161.684 3858.97 175.246 3858.67
C 188.808 3858.37 210.734 3856.9 235.242 3858.67
C 259.75 3860.44 600.702 3873.6 687.208 3877.69
C 773.714 3881.78 1079.22 3891.34 1323.16 3898.61
C 1567.1 3905.87 1668.71 3907.63 1696.13 3908.12 Z
M 910.191 630.39
C 909.694 614.267 906.086 560.891 909.191 556.22
C 912.297 551.55 917.883 551.794 929.19 551.466
C 940.497 551.137 1078.75 548.313 1137.17 547.662
C 1195.59 547.011 1292.63 547.075 1342.16 547.662
C 1391.69 548.249 1468.03 550.305 1477.15 550.515
Y 1486.27 550.725 1487.15 552.416
V 1488.29 575.464 1488.15 589.502
C 1488 603.539 1488.73 645.672 1488.15 647.506
C 1487.57 649.34 1375.36 649.727 1353.16 650.359
C 1330.95 650.99 1018.11 655.11 993.185 655.113
Y 968.262 655.116 913.191 657.015
V 910.689 646.512 910.191 630.39 Z
"/>
</g>
</svg>
I have searched through web regarding the issue "unable to open image `convert': No such file or directory @ error/blob.c/OpenBlob/2643." in the output and found there may be permission issue. I had given all permissions to files that used in the command. But still same issue.

Also I have installed CMYK profile in /Library/ColorSync/Profiles. Sorry, do I need to use CMYK profile file or ISOcoated_v2_300_eci.icc as you do in your command..?

I have no clue how to get rid of these issues and make the command works. Can you please help me..?



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

Re: Clipping Path Name property name disappears in converted TIFF file

Post by snibgo »

identify -quiet -format "%[8BIM:1999,2998:#1]" /users/prasad/E/test/test_input_file.tif convert -quiet ...
This isn't a valid command.

Fred ran two commands. The first began "identify". The second began "convert". He piped the output of the first command into the second command.
snibgo's IM pages: im.snibgo.com
Prasad520
Posts: 9
Joined: 2016-05-13T00:35:34-07:00
Authentication code: 1151

Re: Clipping Path Name property name disappears in converted TIFF file

Post by Prasad520 »

Hi Snibgo & Fred,

Silly me, for the wrong command that I ran.

As suggested I ran two commands using pipe as below

Code: Select all

identify -quiet -format "%[8BIM:1999,2998:#1]” input.tif | convert -quiet input.tif +profile "*" -negate -alpha off -compose copy_opacity -composite -define tiff:alpha=associated -profile /users/prasad/icc-profile/Generic-CMYK-Profile.icc output.tiff
but it throws an exception like and no output file at the destination
convert: no images defined output.tiff @ error/convert.c/ConvertImageCommand/3147.
After searching over the web regarding the issue, some says ghostscript might not installed. But I have ghostscript installed on my machine ( in fact I uninstalled and reinstalled with latest version again but the issue continues )

GhostScript Version

GPL Ghostscript 9.15 (2014-09-22)
Copyright (C) 2014 Artifex Software, Inc. All rights reserved.

IM Version

Version: ImageMagick 6.8.8-6 Q16 x86_64 2014-02-17 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC
Delegates: bzlib fftw jng jpeg lcms lzma png tiff webp xml zlib

Can you please guide me where am I going wrong..??

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

Re: Clipping Path Name property name disappears in converted TIFF file

Post by snibgo »

You haven't followed Fred's suggestion. You have modified it so it doesn't read from the pipe, so "composite" doesn't have two images to work with.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Clipping Path Name property name disappears in converted TIFF file

Post by fmw42 »

Delegates: bzlib fftw jng jpeg lcms lzma png tiff webp xml zlib
Your delegates do not show gs or gslib. So perhaps IM is not finding it. Did you recompile IM after installing Ghostscript?
Prasad520
Posts: 9
Joined: 2016-05-13T00:35:34-07:00
Authentication code: 1151

Re: Clipping Path Name property name disappears in converted TIFF file

Post by Prasad520 »

Hi Fred,

Sorry, after a long break I m resuming this issue again. I have ran the below command as suggested earlier

Code: Select all

identify -quiet -format "%[8BIM:1999,2998:#1]" test_input_file.tif  |\
convert -quiet test_input_file.tif +profile "*" \( - -negate \) \
-alpha off -compose copy_opacity -composite \
-define tiff:alpha=associated \
-profile /Users/fred/images/profiles/ISOcoated_v2_300_eci.icc \
result.tif
But still I m having issues. From your suggestion
Sorry, I have tried everything I know and still get your same error message even for a simple convert. I think there is something strange in one of your profiles that contain PS specific data. However, this round-about method does work. It gets the clip path first and pipes it to the convert command which first removes the profiles and then adds the transparency back from the clip path and re-adds your CMYK profile.
I ran the command, but the 8BIM profile is not piping into convert command. When I checked the output converted image, no 8BIM profile exists.

When I ran "identify -verbose " command for input and output files, the profiles metadata as below

Input Image contains Profiles :

Profile-8bim: 9498 bytes
Profile-icc: 1829077 bytes
Profile-xmp: 35609 bytes


After conversion with profile ISOcoated_v2_eci.icc, the output image contains below profile metadata

Profile-icc: 1829077 bytes

And finally there is no clipping path data in the output file.

Sample Input file : https://www.dropbox.com/s/xreubx2blj2ey ... e.jpg?dl=0

ISOcoated ICC profile: https://www.dropbox.com/s/03zo40cc676k1 ... i.icc?dl=0

I would greatly appreciate it if you kindly give me some suggestion.

PS: The command I ran

Code: Select all

identify -quiet -format "%[8BIM:1999,2998:#1]" new_sample.jpg |\
convert -quiet new_sample.jpg  +profile "*" \( - -negate \) \
-alpha off -compose copy_opacity -composite \
-define tiff:alpha=associated \
-profile /Users/prasad/E/test/Profile/ISOcoated_v2_eci.icc \
new_sample_0utput.tif
Thanks
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Clipping Path Name property name disappears in converted TIFF file

Post by fmw42 »

There will not be any clipping path data in the output. But the image will be masked appropriately. The clip path is turned into a mask and applied to the alpha channel. So the alpha channel now has the equivalent of the clip path.

I do not know how to add the clip path back to the image.

I thought the whole point was to get an image that was clipped to get around your original issue and that is what the command does.

Perhaps EXIFTOOL can add back your clipping path.

Otherwise, one of the IM developers would need to examine your input file and see what the issue might be.
Post Reply