Strange results with clip-path in tif-image

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?".
masterbp
Posts: 27
Joined: 2007-10-08T06:23:33-07:00

Re: Strange results with clip-path in tif-image

Post by masterbp »

http://www.dortheogbenny.dk/test.tif (11.4Mb)
http://www.dortheogbenny.dk/test.jpg (result of convert)

command line:
convert.exe -clip test.tif test.jpg
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Strange results with clip-path in tif-image

Post by magick »

What exactly is the problem. We tried this command:
  • convert test.tif -clip -fill red -draw "color 0,0 reset" test.png
and got a red pillow with the background untouched as expected.
masterbp
Posts: 27
Joined: 2007-10-08T06:23:33-07:00

Re: Strange results with clip-path in tif-image

Post by masterbp »

Well - maybe the problem is my understanding of the -clip option. What is was trying to accomplish was to make the background white (i.e make all pixels outside the clipping path white).
Anyone suggestions how to do that?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Strange results with clip-path in tif-image

Post by magick »

This command works for us (reset everything outside the clip path to white):
  • convert test.tif -colorspace RGB +clip-path #1 -fill white -draw "color 0,0 reset" test.png
masterbp
Posts: 27
Joined: 2007-10-08T06:23:33-07:00

Re: Strange results with clip-path in tif-image

Post by masterbp »

I tried de following command:

Code: Select all

"c:\Program Files\ImageMagick-6.3.6-Q16\convert.exe" test.tif -colorspace RGB +clip-path #1 -fill white -draw "color 0,0 reset" test.png
wich gave me an png image that looked excately like the original (i.e. the clipping was apparently ignored)
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Strange results with clip-path in tif-image

Post by magick »

Don't know what to tell you. We're running ImageMagick 6.3.6-1 under Windows and the command works fine for us (background is white as expected).
masterbp
Posts: 27
Joined: 2007-10-08T06:23:33-07:00

Re: Strange results with clip-path in tif-image

Post by masterbp »

OK - I tried it again on a fairly clean windows install (Xp SP2).
  • Downloaded and installed ImageMagick-6.3.6-1-Q8-windows-static.exe
  • Downloaded sample file from http://www.dortheogbenny.dk/test.tif
  • Ran command

    Code: Select all

    "c:\Program Files\ImageMagick-6.3.6-Q8\convert.exe" test.tif -colorspace RGB +clip-path #1 -fill white -draw "color 0,0 reset" test.png
    
    The program gave the following warnings:

    Code: Select all

    convert.exe: test.tif: unknown field with tag 34152 (0x8568) encountered. `TIFFR
    eadDirectory'.
    convert.exe: Non-conforming drawing primitive definition `color'.
    Resulting image can be seen here: http://www.dortheogbenny.dk/test.png
The resulting image does not have any white background.

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

Re: Strange results with clip-path in tif-image

Post by magick »

Try uninstalling ImageMagick from the Control Panel->Add/Remove Programs. If you know how, make sure c:/Program Files/ImageMagick-6.3.6 folder is deleted. Now download the Q16 dynamic version of the Windows ImageMagick distribution and try your command again. If that works perhaps there is a problem with the Q8 static version of ImageMagick which we will investigate.
masterbp
Posts: 27
Joined: 2007-10-08T06:23:33-07:00

Re: Strange results with clip-path in tif-image

Post by masterbp »

I have now tried with both of the the dynamic versions (Q8 and Q16). Every time uninstalling the previous version and deleting the empy directory. Both version gave the same result as reported in earlier posting.

I tried to run directly from IMageMagick Directory:

Code: Select all

C:\Program Files\ImageMagick-6.3.6-Q16>convert.exe c:\temp\test.tif -colorspace
RGB +clip-path #1 -fill white -draw "color 0,0 reset" c:\temp\test.png
my PATH settings is

Code: Select all

c:\program files\imagemagick-6.3.6-q16;C:\WINDOWS\system32;C:\WINDOWS;
Do you have the binary versions of IMageMagick or do you compile your self?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Strange results with clip-path in tif-image

Post by magick »

Sorry we can't help. We uninstalled our version of ImageMagick and reinstalled the pre-compiled binaries that are on the ImageMagick web site and issued the command. The result was a pillow with a completely white background as expected.
masterbp
Posts: 27
Joined: 2007-10-08T06:23:33-07:00

Re: Strange results with clip-path in tif-image

Post by masterbp »

Very strange. Could you please post your resulting image so I can see the difference?
Post Reply