[HELP] EPS export with clipped image

Post questions on how to use or achieve an effect in Inkscape.
skarabe
Posts: 4
Joined: Fri Oct 07, 2011 6:22 pm

[HELP] EPS export with clipped image

Postby skarabe » Fri Oct 07, 2011 6:37 pm

Hi
I'm new to Inkscape and this forum. I have tried to find a similar post, but nothing quite the same.. I have an Inkscape drawing with an image and text. The image is clipped (Object-Clip-Set) to hide parts I don't want to be visible. The text is ordinary text created with the text tool, placed under the image.

My problem is when I export the image to eps (needed by the printing folks), all text is lost. I export the file as drawing and the space where the text should be is "there", but empty. I have tried various settings with the eps export (page, raster effect etc), but no difference. I have also tried to place the text in a separate layer, but no difference. If I release the clip setting, the text will appear in the eps file. The problem is just that the clipped parts is then also visible..

I can think of two ways to solve this.

1. Get the eps export function to work by altering something I've missed.
2. Remove the clipped parts and not use the clip function (will work too, but i don't know how-to).

Any help will be appreciated.

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: [HELP] EPS export with clipped image

Postby brynn » Sat Oct 08, 2011 12:10 pm

Image
Welcome to InkscapeForum!

I guess the EPS export can be tricky.
So the clip is properly preserved, but the text is not? And if you remove the clip, the text shows up? Hhhmm....
Is the text exported as text? Have you tried converting text to path? That's about all I can think of. But others know more than I do about EPS, so if Object to Path to convert the text to path doesn't work, maybe they'll have other ideas.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: [HELP] EPS export with clipped image

Postby ~suv » Sat Oct 08, 2011 6:40 pm

skarabe wrote:I have an Inkscape drawing with an image and text. The image is clipped (Object-Clip-Set) to hide parts I don't want to be visible. The text is ordinary text created with the text tool, placed under the image.

My problem is when I export the image to eps (needed by the printing folks), all text is lost. I export the file as drawing and the space where the text should be is "there", but empty. I have tried various settings with the eps export (page, raster effect etc), but no difference. I have also tried to place the text in a separate layer, but no difference. If I release the clip setting, the text will appear in the eps file. The problem is just that the clipped parts is then also visible..

If you use a current version of Inkscape (0.48.x) and work on a platform where Inkscape uses a current version of cairo (>= 1.10), then - AFAICT based on your description - this could be a known upstream bug in the cairo library used by Inkscape for the EPS export. Without having access to the SVG source file it is difficult to tell though, since the exact trigger is not fully clear (it isn't reproducible based on your description, and might depend on whether you imported e.g. diagrams created with matplotlib or gnuplot, or are editing a document which was originally based on a different EPS file).

See also: Bug #813886 in Inkscape: “Save as EPS or PS incomplete with cairo >= 1.10
The next release of cairo will include a fix for that one (at least for the known cases which trigger this incorrect applying of clips in the EPS file (objects may disappear because they are incorrectly included in the clip)).

Whether and how a newer or patched cairo version would be available for you depends on your OS. Currently there is no stable or development release available (of Inkscape (Windows and Mac packages include the cairo lib) nor of cairo itself (relevant for linux users mainly) which include the fix.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: [HELP] EPS export with clipped image

Postby ~suv » Sat Oct 08, 2011 6:46 pm

skarabe wrote:I can think of two ways to solve this.

1. Get the eps export function to work by altering something I've missed.
2. Remove the clipped parts and not use the clip function (will work too, but i don't know how-to).
Did you try to change the stack order of the clipped object and the text?

Possibly the text doesn't get wrongly included in the clip [1] if you lower it below the stack level (z-order) of the clipped image.

For more information about the stack order, see also this section in the manual:
Inkscape » Editing Basics » Ordering Objects (Z-Order)


[1] in the exported EPS file

skarabe
Posts: 4
Joined: Fri Oct 07, 2011 6:22 pm

Re: [HELP] EPS export with clipped image

Postby skarabe » Mon Oct 10, 2011 7:44 pm

Hi
Thank you for the very detailed replies. I'm using Inkscape 0.48.2 r9819. I also believe I have the correct Z-order for my objects.

I can easily reproduce this and have attached a basic sample to illustrate my problem. Hopefully this will help you understand my setup. It looks like it may be related to the issue, posted above. If this is the case, is there any good way to permanently remove the clipped parts of my image?

Thanks!
Attachments
test.jpg
EPS files not allowed for upload, so here's the EPS output in jpg format.
test.jpg (23.81 KiB) Viewed 3636 times
test.svg
(7.09 KiB) Downloaded 211 times

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: [HELP] EPS export with clipped image

Postby ~suv » Mon Oct 10, 2011 10:07 pm

skarabe wrote:I'm using Inkscape 0.48.2 r9819.
On which OS / platform?
skarabe wrote:I also believe I have the correct Z-order for my objects.
You misunderstood: you had asked for workarounds, and I tried to offer one (which I just confirmed with your file).

Yes, it is the mentioned bug [1], and stacking the text below the group containing multiple clipped paths causes the text object to be processed before the clip when exporting to EPS, and thus it does not get incorrectly included in the clip (i.e. the text is visible in the EPS file).

Depending on your platform, you can try the workaround, or wait until a new version of cairo is released (and/or a new Inkscape release with the newer version of cairo - in case you use Inkscape on Windows or Mac OS X).


[1] As I had commented there for the test case attached to the bug report, linked with a current build of cairo master (which includes the fix) Inkscape 0.48.2 exports your file correctly to EPS (without any edits or workarounds).

skarabe
Posts: 4
Joined: Fri Oct 07, 2011 6:22 pm

Re: [HELP] EPS export with clipped image

Postby skarabe » Mon Oct 10, 2011 10:45 pm

Thanks ~suv for the quick and good reply. I admit I should have read your first answer more thorough. Sorry about that.

I'm on Windows, so the workaround will not work for me.
Again, thanks for the great support.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: [HELP] EPS export with clipped image

Postby ~suv » Mon Oct 10, 2011 10:56 pm

skarabe wrote:I'm on Windows, so the workaround will not work for me.
No. Hmm - how should I explain it without causing even more confusion with each answer I try to give? ;)

Pleae, please do try the workaround - I see no reason it would not work on Windows (it's called a workaround because it offers a (limited) solution until the bug is really fixed).

If the workaound works on a Mac with Inkscape 0.48.2 (and cairo 1.10.2), why should the workaround not work on Windows with Inkscape 0.48.2 (and cairo 1.10.2)?

If it helps, I'll attach the slightly edited SVG file (the text lowered in z-order)…

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: [HELP] EPS export with clipped image

Postby ~suv » Mon Oct 10, 2011 11:04 pm

This modified file (the group with the clipped objects has been rasied to the top - see menu 'Object > Raise to the Top' - so that in z-order it is above the text object) exports correctly to EPS (despite the bug).

Please test on Windows with Inkscape 0.48.2…
Attachments
skarabe-test-workarouand.svg
(7.1 KiB) Downloaded 231 times

skarabe
Posts: 4
Joined: Fri Oct 07, 2011 6:22 pm

Re: [HELP] EPS export with clipped image

Postby skarabe » Mon Oct 10, 2011 11:42 pm

Thanks again ~suv for being persistent! I guess I was intimidated by the workaround since I smelled application file hacking and that's really not my home turf. But, after playing more with the Z-order (after being able to successfully export the workaround svg you sent) I got it to work!

Easy fix really, but not apparent to me. Thanks a million for helping me out with this one!!


Return to “Help with using Inkscape”