Give object a transparent background/alpha layer

Post questions on how to use or achieve an effect in Inkscape.
mickeydog
Posts: 38
Joined: Tue Jul 09, 2013 1:22 pm

Give object a transparent background/alpha layer

Postby mickeydog » Sun Jul 14, 2013 4:01 am

Another rookie question. The attached svg has 2 layers: hair and face, the hair layer is on top of the face layer. The problem is that the objects in the hair layer have a white background, instead of a transparent background, and so occlude the face. How do I make the hair objects have a transparent background?
Note that I do not want to change the transparency of the object, but rather add an alpha layer to it.
Attachments
ObjectBGNotTransparent.svg
(22.12 KiB) Downloaded 220 times

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Give object a transparent background/alpha layer

Postby Lazur » Sun Jul 14, 2013 4:08 am

This can be done in a quite good way with the trace bitmap option.
Attached is the result of a quick auto-tracing.
Attachments
hlp58.svg
(6.26 KiB) Downloaded 265 times

mickeydog
Posts: 38
Joined: Tue Jul 09, 2013 1:22 pm

Re: Give object a transparent background/alpha layer

Postby mickeydog » Sun Jul 14, 2013 4:46 am

Thanks for the reply. The svg you attached is indeed what I want, but I need to learn to do it myself.
I must not be doing it right. With the Select and Transform Object tool, I select the hair.
Then I select Path -> Trace Bitmap
I select Edge Detection and click Ok. The hair becomes outlines, but the bg is still white.
Also tried Brightness cutoff with a high setting for the threshold so it 'sees' the yellow, but nothing happens there.
Last edited by mickeydog on Sun Jul 14, 2013 5:05 am, edited 1 time in total.

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Give object a transparent background/alpha layer

Postby Lazur » Sun Jul 14, 2013 5:04 am

I used the colour option with the number of colours set to two.
This way only two paths are made, one for the shape and one for the background.
After that, the objects were ungrouped and the white background removed.

And, by the way this kind of tracing could be done in a relatively small time with the pen tool manually as well,
which way you could draw exactly what you want.

mickeydog
Posts: 38
Joined: Tue Jul 09, 2013 1:22 pm

Re: Give object a transparent background/alpha layer

Postby mickeydog » Sun Jul 14, 2013 5:13 am

You mean Color Quantization set to 2, I think.
I"ve tried that and not getting anything. Here's the steps I am taking

- using Select and Transform objects tool, I select one of the hair objects
- Path -> Trace Bitmap
- Color quantization - 2
- click OK
- nothing happens

Screen shot of dialog box:
TraceBitmap.png
TraceBitmap.png (44.12 KiB) Viewed 3536 times

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Give object a transparent background/alpha layer

Postby Lazur » Sun Jul 14, 2013 5:25 am

I meant multiple scans>colors.
I don't have the english interface so not always sure of the original interface's option.
If you tick in the remove background than it may produce only the wanted path.

mickeydog
Posts: 38
Joined: Tue Jul 09, 2013 1:22 pm

Re: Give object a transparent background/alpha layer

Postby mickeydog » Sun Jul 14, 2013 5:44 am

Ok, I selected Colors and Remove background, but nothing still.
When you select Colors, how do you set the number of colors to 2?

MultipleScans-Colors.png
MultipleScans-Colors.png (43.02 KiB) Viewed 3531 times

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Give object a transparent background/alpha layer

Postby Lazur » Sun Jul 14, 2013 5:55 am

At the scans where it's set to 8 on that image.

mickeydog
Posts: 38
Joined: Tue Jul 09, 2013 1:22 pm

Re: Give object a transparent background/alpha layer

Postby mickeydog » Sun Jul 14, 2013 6:09 am

I had tried that, but it didn't matter. I've attached a screenshot of the dialog and the image so you can see what I see, which show that the hair selected does not have transparent background. I apologize for this turning into an ordeal. What can you suggest now?
Screen shot.png
Screen shot.png (117.3 KiB) Viewed 3530 times

Lazur
Posts: 4717
Joined: Tue Jun 14, 2016 10:38 am

Re: Give object a transparent background/alpha layer

Postby Lazur » Sun Jul 14, 2013 6:17 am

I see somehow your trace turned black but don't know why, it works fine here with the settings mentioned.
Actually on the left image with yellow, there is a slight black outline.
I'm guessing you have a black traced version with a yellow traced one above it -so at least once you could make it right.
After you trace the bitmap, delete the original image, because if it's still there it will block the parts below it.

mickeydog
Posts: 38
Joined: Tue Jul 09, 2013 1:22 pm

Re: Give object a transparent background/alpha layer

Postby mickeydog » Sun Jul 14, 2013 6:25 am

Oh! I didn't know it was creating another image on top of the other, I thought it was converting it.
So, yes, when I delete the original underneath, then the transparency shows through.
Thank you very much.


Return to “Help with using Inkscape”