This project has moved and is read-only. For the latest updates, please go here.

How to Prevent Removal of Anything Outside of the Clipping Path When Converting From EPS

Sep 5, 2016 at 3:40 PM
Hi,

I want to convert an EPS file with a clipping path to a JPEG. I want to preserve the clipping path info, but I do not want the clipping path to be applied as a mask.

No matter what I do, anything outside of the clipping path is painted as white in the JPEG which is produced.
Oddly, if the file is written to the Windows desktop, the icon is rendered correctly (nothing converted to white), but if I open the desktop folder in Windows Explorer, the file icon has all the area outside of the icon masked as white.

This works without problem when converting from PSD to JPEG

What am I doing wrong?

ENVIRONMENT: Win 10 Anniversary, VS2015 SP3, GS 9.19 64 bit, ImageMagick 7.0.3.1 8bit Color AnyCpu)

TIA,
mlavie
Sep 5, 2016 at 4:09 PM
Can you add the images to your post so I can understand better what you are trying to do and what the problem is?
Sep 5, 2016 at 4:22 PM
Sorry for the stupid question, but how can I upload a file to my post?
Sep 5, 2016 at 4:23 PM
Adding a link to your file on DropBox/OneDrive is the way to go on CodePlex.
Sep 5, 2016 at 4:40 PM
Edited Sep 5, 2016 at 4:50 PM
You can download the source EPS and the JPEG result from the following links.
NOTE!!!: Remove all Y's from the links (anti spam):

http://YYYxcserver006.YYYxcircular.com/otter2.eps
http://YYYxcserver006.YYYxcircular.com/otter2.jpeg
Sep 5, 2016 at 8:22 PM
Edited Sep 5, 2016 at 8:48 PM
I am still not sure what the your desired result is but it looks like you want to write your image to a PNG instead of a JPG? The area outside the mask is transparent and will become white when you save it as a JPG file. Are you happy with the result as a PNG?
Sep 6, 2016 at 8:34 AM
Edited Sep 6, 2016 at 9:08 AM
Hi,

No - I want a JPEG and I want the Adobe IRB 8BIM path information preserved, but I do not want the clipping path actually applied (i.e., there should be no masking of the area outside of the clipping path). When I view the EPS in Photoshop, I see all of the image, including the area outside of the path. I expect to see the exact same thing in the JPEG created from the EPS.

Therefore, in this instance, I would have expected that the JPEG would show the entire original image, without any mask of any color overriding the area outside of the clipping path. If you place the JPEG I sent you on your desktop, you'll see that the background is not masked out. You only see it masked out if you view it in Windows photo viewer, etc.

I think that converting an EPS to JPEG should behave just like when converting a PSD to JPEG. In the case of converting a PSD, the path info (Adobe IRB 8BIM data) is preserved, but the area outside of the path is not masked to white.

Please let me know if this is not clear.

TIA,
mlavie
Sep 6, 2016 at 2:14 PM
Edited Sep 6, 2016 at 2:14 PM
Is it possible that you would need to deactivate the mask in Photoshop? Ghostscript is used with the default parameters so I am not sure how we could tell it to disable the clipping path. Would you mind checking if Ghostscript has an option for that if you cannot deactivate it in Photoshop?
Sep 6, 2016 at 3:12 PM
Edited Sep 6, 2016 at 3:50 PM
I'll try. I really don't know Ghostscript. Photoshop can deactivate a clipping path, but then the software which should be applying the clipping path mask will not have that path available for use.

I find it odd that by default the clipping path behavior for converting EPS to JPEG is different from the converting PSD to JPEG.

Would you by chance know what the "leading" Ghostscript web forum is?
Sep 6, 2016 at 6:44 PM
Edited Sep 6, 2016 at 6:44 PM
The coder for PSD is written by the ImageMagick team and we did not write the Ghostscript library. This makes it possible for us to determine the behavior of the PSD reader. The primary site for Ghostscript is: http://www.ghostscript.com/. I don't think they have a forum.