Questions tagged [mask]

An image mask is a bitmap that specifies an area to paint, but not the color. In effect, an image mask acts as a stencil to specify where to place color on the page. Quartz uses the current fill color to paint an image mask.

A mask is a format expression mainly used in formatting user input in forms.

Common examples of this are date input fields that accepts only numbers and format the typed input with the needed characters:

User enters      Field contents
1                1
12               12
123              12/3
1231             12/31
...              ...
12312012         12/31/2012
2841 questions
19
votes
3 answers

How to make SVG "fill" act in a similar way to CSS "background-size: cover"

I'm am trying to create an SVG which masks an image with a particular path however, when I try to fill the area using a pattern, the image does not cover the entire area. Expected Actual In my defs I am defining the pattern:
Godwin
  • 9,739
  • 6
  • 40
  • 58
19
votes
3 answers

How do I get masked date in model from input in angular using ui-mask?

I have a view which requires that the user enter their birthdate into a textbox. I am using the mask directive from UI-Utils. My view has this input element in it:
stephen776
  • 9,134
  • 15
  • 74
  • 123
19
votes
6 answers

How to draw CALayer border around its mask?

So, I have a CALayer, which has a mask & I want to add border around this layer's mask. For example, I have set triangle mask to the layer and I want to have border around that layer. Can anyone please help me to solve this problem?
Fahri Azimov
  • 11,470
  • 2
  • 21
  • 29
18
votes
3 answers

OpenCV & Python: Cover a colored mask over a image

I want to cover a image with a transparent solid color overlay in the shape of a black-white mask Currently I'm using the following java code to implement this. redImg = new Mat(image.size(), image.type(), new Scalar(255, 0,…
Will Li
  • 495
  • 1
  • 3
  • 12
18
votes
5 answers

Masking a Drawable/Bitmap on Android

I'm currently looking for a way to use a black and white bitmap to mask the alpha channel of another bitmap or Drawable on Android. I'm curious as to what the best way to do this is. I certainly have a couple of ideas for how to do this, but they…
Joshua Rodgers
  • 5,317
  • 2
  • 31
  • 29
17
votes
1 answer

list of masked functions in R

I use a lot of packages and I know some functions are masked because they exist in several different packages. Is there a way to get the list of duplicate functions (or masked functions?) The ideal would be to have a list of duplicate function and…
RockScience
  • 17,932
  • 26
  • 89
  • 125
17
votes
6 answers

Delphi InputBox for password entry?

Inputbox: answer:=Inputbox('a','b','c'); works good, but I'm looking for a masked one, like a password box where you only see little stars instead of the typed characters.
Arthur
  • 3,376
  • 11
  • 43
  • 70
16
votes
1 answer

Is there a -moz-mask CSS property, like -webkit-mask-image?

It seems -moz-mask-image is not supported in Firefox. I am attempting a foreground gradient. I can't use an image as i need the text to be selectable. Does anyone have any ideas for Firefox? This version works in chrome and…
MALK
  • 393
  • 1
  • 3
  • 15
16
votes
4 answers

Imagick: compose with mask

I try to recreate a script that uses the ImageMagick command "convert" to compose an image. But I want to do the same in PHP using Imagick (version 6.6.2-10). The command is as follows: convert A1.mpc A3.mpc A4.mpc -channel rgba -alpha on…
Michael
  • 200
  • 2
  • 10
15
votes
1 answer

How to use a mask with QPainter?

I have a shape (in blue) loaded from a PNG with transparency: Then I'm drawing several circles on top of this shape (in red) with QPainter::drawEllipse. The result of that is somewhat similar to the third picture with the red shape completely…
laurent
  • 88,262
  • 77
  • 290
  • 428
15
votes
2 answers

Reverse a CALayer mask

I am trying to use a CALayer with an image as contents for masking a UIView. For the mask I have complex png image. If I apply the image as a view.layer.mask I get the opposite behaviour of what I want. Is there a way to reverse the CAlayer? Here…
arvidurs
  • 2,853
  • 4
  • 25
  • 36
15
votes
3 answers

Pandas best way to subset a dataframe inplace, using a mask

I have a pandas dataset that I want to downsize (remove all values under x). The mask is df[my_column] > 50 I would typically just use df = df[mask], but want to avoid making a copy every time, particularly because it gets error prone when used in…
sapo_cosmico
  • 6,274
  • 12
  • 45
  • 58
15
votes
2 answers

OpenCV: How to get inlier points using findHomography()/findFundamental() and RANSAC

OpenCV does not provide a RANSAC-function per se or at least in such a form that you can just call it and be done with it (e.g. cv::ransac(...)). All functions/methods that are able to use RANSAC have a flag that enables it. However this is not…
rbaleksandar
  • 8,713
  • 7
  • 76
  • 161
15
votes
6 answers

Reposition/resize UIBezierPath

I have a draggable view that has a mask layer on it. The mask layer has a UIBezierPath on it which makes an area on the view see-through/transparent(the effect that i want). My end goal is to change the position and size of the path(not the mask…
Soc
  • 153
  • 1
  • 1
  • 5
15
votes
1 answer

Is there an inverse to the CSS "Clip" property; hide the clipped area?

The CSS clip syntax gets you to define a rectangular area of a larger image that you wish to be visible. Is there a way to specify the inverse? Specify the rectangular area of the image that you wish to become invisible. Like punching a rectangular…
Dominic
  • 587
  • 3
  • 9
  • 19