Page 1 of 1

Removing backgound by applying clipping path

Posted: 2007-10-11T00:55:29-07:00
by masterbp
Hi

I'm trying to remove the background of an image by using the photoshop clipping path embedded in the image, but ImageMagick seems to ignore the clippping path

Here is what i did:
  • Downloaded and installed ImageMagick-6.3.6-1-Q8-windows-static.exe
  • Downloaded sample file from http://www.dortheogbenny.dk/test.tif (11Mb)
  • 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 (14Mb)
The resulting image does not have any white background.

I have tried with all binary versions for windows from the Imagemagick Website - all with the same result. Could anyone give me a hint about what I do wrong?

Re: Removing backgound by applying clipping path

Posted: 2007-10-20T14:59:23-07:00
by masterbp
I have now tried the above command, but this time with env. variable MAGICK_DEBUG set to 'all'. I now get a lot of debug information, but i still can't figure out why Imagemagick won't apply the clipping path.

The log file can be downloaded here: http://www.dortheogbenny.dk/output.zip (2Mb)

There is no apparent errors in the log, except for the mentioned 'convert.exe: Non-conforming drawing primitive definition `color'.' error.

Could anyone help me out?

Thanks!

Benny

Re: Removing backgound by applying clipping path

Posted: 2007-10-20T17:48:30-07:00
by magick
Weird wild stuff. We download 6.3.6-3 Q8 static under Windows and converted your image without any complaints.

Re: Removing backgound by applying clipping path

Posted: 2007-10-22T00:25:47-07:00
by masterbp
Hi

I came a little step further:
Using Process Monitor, I could see that ImageMagick was looking for Ghostscript using registry lookups. I installed ghostscript and now the error messages have disappered.

(Process Monitor Log can be downloaded here: http://www.dortheogbenny.dk/convert.exe.zip)

But the resulting image still has a background :(

I'm almost out of ideas except checking versions of each and every depending DLLs

Any ideas?

Regards,

Benny

Re: Removing backgound by applying clipping path

Posted: 2007-10-23T23:42:04-07:00
by masterbp
Hi

I have done some more testing with clipping path and Imagemagick. This time i tried the following command:

Code: Select all

convert test.tif -clip -fill red -size 640x480 test.png


I got the following results:

Windows XP (SP2)
Tested on four different machines (all with different setup/ patch level) using Convert.exe version 6.3.6Q8 static. The resulting image looks very wierd and the clipping path is still ignored. Image can be seen here:
http://www.dortheogbenny.dk/test_windows.png

Linux (Ubuntu LiveCd v7.0.4)
Tested with convert version 6.2.4 Q16. Worked as expected. Image can be seen here:
http://www.dortheogbenny.dk/test_linux.png

Re: Removing backgound by applying clipping path

Posted: 2007-10-25T02:10:21-07:00
by masterbp
Hi

Now I managed to find a Windows 2003 server which works perfectly. I have no idea what the difference is though :(