Stupid black rectangle with transparent hole

Post questions on how to use or achieve an effect in Inkscape.
davide445
Posts: 5
Joined: Mon Jun 01, 2015 9:05 am

Stupid black rectangle with transparent hole

Postby davide445 » Mon Jun 01, 2015 9:14 am

Need to create a mask to be used as overlay with my video editor program (PowerDirector). Using Inkscape 0.91

Need to be a 1920x1080 (FullHD) black rectangle with a transparent hole in the center, sized 728x540.

I did define the Document properties with FullHD size, background white w 100% transparent alpha channel, used 4 rectangles to shape the central hole.

Using File>Export PNG Image I did obtain an image with the central rectangle white.

Tried to do the opposite and defining the document background black but 100% opaque and using a central white transparent rectangle, same result.

It's really a stupid task but I'm not able to do it, can you please give me any suggesion.
Attachments
Mask squared PD.png
Mask squared PD.png (7.23 KiB) Viewed 5310 times

User avatar
Espermaschine
Posts: 892
Joined: Thu Jun 05, 2014 9:10 pm

Re: Stupid black rectangle with transparent hole

Postby Espermaschine » Mon Jun 01, 2015 9:41 am

set document properties (Shift + Ctrl + D) to 1920x1080px
activate 'snap to page border' in the snap bar
draw rectangle 1920x1080px, which should be easy because of the snapping
select, make it black with no Stroke

draw another rectangle (in any other colour than black), type in the values you want (728x540px)
align to the center of the page with the alignment tool

select black rectangle, then with the Shift key pressed down, include the white rectangle
perform a 'Difference' (Ctrl + minus)

export page
Attachments
Mask.svg
(2.08 KiB) Downloaded 217 times

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Stupid black rectangle with transparent hole

Postby druban » Mon Jun 01, 2015 9:57 am

davide445 wrote:I did define the Document properties with FullHD size, background white w 100% transparent alpha channel...

Well, you're almost there.
The overlapping area can be made 'transparent' by selecting both and using 'ctrl K' or Path menu > combine. It's best if the smaller or inner path has a fill that you can see before so you can note its absence after. If this operation has no effect, one of the paths needs to be reversed (path menu reverse) or the fill rule needs to be switched (fill and stroke dialog, top right area)
Your mind is what you think it is.

davide445
Posts: 5
Joined: Mon Jun 01, 2015 9:05 am

Re: Stupid black rectangle with transparent hole

Postby davide445 » Mon Jun 01, 2015 5:47 pm

Thanks for your reply.

I think the problem is the export. Every time I export to PNG the central rectangle became a white and not transparent.

Need I to care about something exporting into png?

User avatar
druban
Posts: 1917
Joined: Fri Nov 20, 2009 10:48 pm

Re: Stupid black rectangle with transparent hole

Postby druban » Mon Jun 01, 2015 6:56 pm

It works for me. One thing to note -- when you say 100% transparent alpha channel in document properties - I wonder if you are making the alpha fully opaque instead. The A slider should actually be all the way to the left, not the right, minimum value (0), not maximum. In document properties for background color you should then see a checkerboard in half the area, not a fully white swatch.
Your mind is what you think it is.

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

Re: Stupid black rectangle with transparent hole

Postby Lazur » Mon Jun 01, 2015 8:16 pm

If it's a black and white image, you can make a quick fix -for this image at least- in gimp by adding alpha channel (to the layer) by (white) colour.

davide445
Posts: 5
Joined: Mon Jun 01, 2015 9:05 am

Re: Stupid black rectangle with transparent hole

Postby davide445 » Mon Jun 01, 2015 8:17 pm

Ok that works!! I'm dying for such a stupid task, really angered with my inability to obtain these trivial things.
Maybe using Inkscape for such stupid task is such as using a cannon for a bug, but Paint or Paint.net didn't achieve the result in an easier way.

So next task is: did want the border of the central transparent rectangle to be diffuse and not sharp so to have a gradual transition, any way to do this?

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

Re: Stupid black rectangle with transparent hole

Postby Lazur » Mon Jun 01, 2015 8:28 pm

Sounds antialiasing made it smooth. Check if your exporting area -resolution- and object is laying on the same pixel grid, as well as there are no strokes.

davide445
Posts: 5
Joined: Mon Jun 01, 2015 9:05 am

Re: Stupid black rectangle with transparent hole

Postby davide445 » Mon Jun 01, 2015 8:44 pm

No way to use gradient tool to better control the transition size?

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

Re: Stupid black rectangle with transparent hole

Postby Lazur » Mon Jun 01, 2015 9:25 pm

Oh sorry I misunderstood. Usually the problem is sharp doesn't appearing enough sharp.

For a black to transparent, "random" shaped gradient you better off starting to draw black to white transitions, then using masking, or gimp to add alpha by colour as suggested above.

How sharp you want the corners of the gradient to look like?

davide445
Posts: 5
Joined: Mon Jun 01, 2015 9:05 am

Re: Stupid black rectangle with transparent hole

Postby davide445 » Mon Jun 01, 2015 10:12 pm

This is the final result want to obtain (obtained using Blur effect in my video editor on that mask)
Attachments
Overlay with blur.JPG
Overlay with blur.JPG (44.73 KiB) Viewed 5213 times

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

Re: Stupid black rectangle with transparent hole

Postby brynn » Tue Jun 02, 2015 12:20 am

Aahh, if we only had the example from the start! I wasn't understanding the first description. And actually, I'm not very good with masks, so I won't try. But I think this particular effect is easier in GIMP than Inkscape. Although I could be wrong. Maybe there's a handy filter for this?

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

Re: Stupid black rectangle with transparent hole

Postby Lazur » Tue Jun 02, 2015 1:15 am

Here are some variants, the possibilities are infinite:
maskfullHD.svg
(503.56 KiB) Downloaded 222 times

User avatar
Espermaschine
Posts: 892
Joined: Thu Jun 05, 2014 9:10 pm

Re: Stupid black rectangle with transparent hole

Postby Espermaschine » Tue Jun 02, 2015 1:22 am

You can put the Mask i attached (exported as a png of course) in Gimp and apply Gaussian Blur (say 20px) to get what you want.


Return to “Help with using Inkscape”