FAQ Database Discussion Community


Create an image-overlay mask in javafx

image,javafx,imageview,overlay,mask
I'm trying to do a simple thing. I have a binary image and all I want is to overlay the binary image on a color image, but the white pixels in the binary image should be red, and the black transparent. I'm quite used to JavaFx but I'm stuck with...

Mask CALayer with Another CALayer

ios,xcode,swift,calayer,mask
I'm trying to mask one CALayer(newSticker) with the image of another layer(stickerMask), like so: func placeSticker(location: CGPoint) { let stickerMask = CALayer() stickerMask.contents = UIImage(contentsOfFile:NSBundle.mainBundle().resourcePath!.stringByAppendingPathComponent("brush\(self.stickerSelected).png"))!.CGImage stickerMask.frame = CGRect(x: location.x * 100, y: location.y * 100, width: 200, height: 200) let newSticker = CALayer() newSticker.backgroundColor = UIColor(red: self.red, green: self.green, blue:...

firefox 35.0.1: svg mask animation doesn't work

firefox,animation,svg,mask,snap.svg
after my firefox update to version 35.0.1 my svg animations doesn't work in firefox, but it was working in previous versions and it still works in firefox beta (36), nightly (37.0a2) and other browsers (opera, chrome, safari, modern ie): html: <svg version="1.1" id="logo-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="55px" height="53.758px" viewBox="-1061.986...

Swift: Mask Alignment + Auto-Layout Constraints

swift,calayer,mask
I have this PNG file, which I'd like to use as a mask for a UIView. The view must be: 20 pixels/points in from each side A perfect square Centered vertically I set the following constraints to accomplish this: However, it seems these constraints don't play well with masks. When...

Avoid hit area on link masked with css mask

css,css3,mask,masking
I have a thousand of text links that are masked by a png image using mask property of css3, I want to remove hit from link that are hidden by png mask, bellow are two images, the first one is the links without masking, and second is the masked links...

Subtract UIView from another UIView in Swift

ios,swift,calayer,mask
I'm sure this is a very simple thing to do, but I can't seem to wrap my head around the logic. I have two UIViews. One black, semi-transparent and "full-screen" ("overlayView"), another one on top, smaller and resizeable ("cropView"). It's pretty much a crop-view setup, where I want to "dim"...

Getting masked area to be transparent?

c++,opencv,transparent,image-manipulation,mask
So far i have managed to use masks and get the second image from the first. But what i want is the black area in second image to be transparent (i.e the output i an trying to get is the third image) Here is the code so far. Please advice...

Unity | 'gameobject.renderer.material.color' in version 5.x

unity3d,shader,crop,mask,renderer
I want to make a portion of the gameObject(guiTexture or sprite) as transparent color like "SpriteMask" which is in asset store. https://www.assetstore.unity3d.com/kr/#!/content/27642 Let me explain in more detail. For example, there are two gameObject in the scene. One is the background of the scene and the other one is just...

SpriteKit SKCropNode Masks everything

objective-c,ios8,sprite-kit,mask,skcropnode
I am trying to mask a node with SKCropNode class. I am doing it with my own init method in SKCropNode inherited class: - (id)init { self = [super init]; if (self) { self.maskNode = [[SKSpriteNode alloc] initWithColor:[SKColor blackColor] size:(CGSize){50,50}]; SKSpriteNode *contentNode = [[SKSpriteNode alloc] initWithImageNamed:@"Spaceship"]; [self addChild: contentNode]; self.userInteractionEnabled...

AS3 Draggable layer/mask on y axis

image,actionscript-3,draggable,mask,movieclip
I'd like to create this exact example: http://www.nytimes.com/2008/12/28/nyregion/18thennow.html?_r=2& however have the drag occur on the y axis instead of the x. I was working with some basic code, but wondering how to lock it in place? myImage.mask = myMask; stage.addEventListener(MouseEvent.MOUSE_DOWN, fMouseDown); stage.addEventListener(MouseEvent.CLICK, fMouseUp); function fMouseDown(e:MouseEvent):void { myMask.startDrag(); } function fMouseUp(e:MouseEvent):void...

How Swiffy antialias canvas?

javascript,canvas,mask,antialiasing,google-swiffy
I don't understand how swiffy succefully antialias clipping mask when it exports a flash animation that contains mask. Here is my exemple : Full canvas, with mask. Super dirty in Chrome : http://goo.gl/n8yB5h And a swiffy export where there is a picture that move inside a mask. Super clean on...

masking a double over a string

string,matlab,double,mask
This is a question in MatLab... I have two matrices, one being a (5 x 1 double) : 1 2 3 1 3 And the second matrix being a (5 x 3 string), with spaces where no character appears : a bc def g hij I am trying to get...

Create three circle mask with canvas

javascript,html5,canvas,mask
I need to create a circle mask with canvas, I'm trying to do that, but I can't get it. I knew to do that with Flash, but I prefef to do without that technology: May anybody help me with this? I don't know too much about javascript What I need...

An SVG rectangle with multiple holes using Snap.svg

javascript,svg,mask,snap.svg
I'm trying to get a rectangle with many (transparent, not just of the same color as the background!) round holes, but my code does the opposite. I know why, but I don know how to generate a suitable mask shape in this case: var s = Snap(500, 500); var rectangle...

Fill image with texture/pattern

javascript,canvas,html5-canvas,drawing,mask
I'm looking for a solution to change the texture/pattern for a product. At this moment i have: A .png picture of a couch with a transparent background A .png picture of a texture With the following code: <canvas id="a" width="800" height="500">Canvas not supported on your browser</canvas> var width = $(window).width();...

Mask & Unmask websocket data in python

python,websocket,mask
I have an websocket that is connected to my Websocket server in python, but i can't read any data because it's masked. So i wonder how to mask & unmask data in python, haven't found anything. I have an simillar websocket server in PHP that looks like this: function unmask($text)...

Converting subsripts and indices

matlab,indexing,mask,subscript,roi
I'm having a hard time figuring out transformation between spaces using ind2sub and sub2ind. Could someone help? The problem is as follows: I have a mask Y (or region-of-interest) in which voxel values are either 1 or zero: Y=72x72x33 double. I then find all the voxels with value of 1...

Using mask to show/hide a view with animation

ios,ios8,calayer,mask,bounds
I am trying to use a mask to hide and show a view, but I cannot get it work correctly for some reason. I am really confused about whether I should animate the frame/bounds/path of the mask. Here is my code to show a view on a button action "GO":...

Pentaho convert string to integer with decimal point

string,format,pentaho,mask,kettle
I am importing text values into a transformation using a Fixed Width input step. Everything is coming in as a string. I want to convert some of the string values to integers with a decimal point at a specified spot. Here are some examples of the before (left hand side)...

Using a UIButton to mask a moving UIView

ios,objective-c,uibutton,mask
I want to bind two views to a button's border like a mask. The effect I want is seen in the image below So I have a custom controller that uses a PageViewController to swipe between two UIViewControllers. I also have two views (the red one and the blue one)....

How to mask keyboard interrupt using IMR in 8086?

keyboard,interrupt,mask,8086
I would like to disable keyboard interrupts, by masking it in the IMR. I'm not really sure how to access it, and change it? As I realize, it's on the IRQ1 line, so the bit 1 should be 0....

trouble using a mask to manipulate a bit

c,bit-manipulation,mask
I'm working on a function that returns 1 when x can be represented as an n-bit, 2’s complement number and 0 if it can't. Right now my code works for some examples like (5,3),(-4,3). But I cant get it to work for instances where n is bigger than x like...

Create mask from bwtraceboundary in Matlab

image,matlab,image-processing,mask,boundary
I'm trying to create a mask (or similar result) in order to erase pieces of a binary image that are not attached to the object surrounded by the boundary. I saw this thread (http://www.mathworks.com/matlabcentral/answers/120579-converting-boundary-to-mask) to do this from bwboundaries, but I'm having trouble making suitable changes to it. My goal...

SVG Mask Transparent Circle - Show only text without yellow background

javascript,html,image,svg,mask
Hello I'm new to svg masks and I have the following problem: The circle is a svg mask which follows the cursor over the image. Behind the image is another image with a tagcloud which is an png with transparent background. Now I just want to see the text from...

Byte Pattern Finding (Needle in Haystack) - Wildcard/Mask?

c#,arrays,byte,wildcard,mask
this is my first time using StackOverflow so sorry if I'm vague :P I have this piece of code, which searches for a pattern in a byte array and returns it's position. public int FindPattern(byte[] Body, byte[] Pattern, int start = 0) { int foundIndex = -1; bool match =...

OpenCV & Python: quickly superimpose mask over image without overflow

python,opencv,numpy,mask
I'd like to superimpose a binary mask over a color image, such that where the mask is "on", the pixel value changes by an amount that I can set. The result should look like this: I am using OpenCV 2.4 and Python 2.7.6. I have a way that works well,...

how to mask data fields in mysql?

php,mysql,mask
I have a table containing special data and I need to hide those data after I backup them for example I have a filed containing phone number like this 0020158578939 I need to make it like this 002015******* whats is the sql command I must use to do this. I...

Create mask from color Image in C++ (Superimposing a colored image mask)

c++,algorithm,opencv,image-processing,mask
I've wrote a code which detects squares (white) in realtime and draws a frame around it. Each side of length l of the squares is divided in 7 parts. Then I draw a line of length h=l/7 at each of the six points evolving from the deviation perpendicular to the...

actionscript 3.0 visible mask over a visible masked object

actionscript-3,mask
I have a moving truck in my game and I want the city lights reflections (NOT the background) to be visible over its body as it moves around. What stands behind the truck does not matter, some trees and buildings. So, I add the background (not important); then I add...

Loading delay extjs

javascript,extjs,panel,loading,mask
I have a panel within which I have two more panels. When you click on panel1 then information in panel2 is loaded. Since the information is quite huge there is some delay when its being loaded. During this interim period I wish to add a loading mask which intimates the...

Python - parallelize a python loop for 2D masked array?

python,loops,numpy,parallel-processing,mask
Probably a commonplace question, but how can I parallelize this loop in Python? for i in range(0,Nx.shape[2]): for j in range(0,Nx.shape[2]): NI=Nx[:,:,i]; NJ=Nx[:,:,j] Ku[i,j] = (NI[mask!=True]*NJ[mask!=True]).sum() So my question: what's the easiest way to parallelize this code? ---------- EDIT LATER------------------ An example of data import random import numpy as np...

How to create rotated rectangular or polygonal ROI/mask?

c++,opencv,mask,threshold,roi
Let's say i have the following image: And my region of interest looks like this: And i want to have the following result: How can i achieve this knowing that the ROI is denoted by four points: Point pt1(129,9); Point pt2(284,108); Point pt3(223,205); Point pt4(67,106); ...