Photoshop layer blending - null out background - photoshop

Is it possible using layer blending and maybe masking to null out the background(transparent) using a picture with the product in place and one without the product as a background reference picture.
Like a layer mask that only reveals where images are different. (Product and shadow)
Thanks in advance.

Totally possbile but i'm not sure you'll get the desired effect. If you want to subtract absolutely just the areas where there are color differences that means shadow edges will be pixelated. Nonetheless, here's how you do it
Set up your layers like so:
Layer 1 (background + product baked in on top)
Layer 2 (background only)
Set Layer 1 blending mode to "Difference" --All the pixels with the same color information will turn black.
Flatten this and we'll call it "Layer 3 (Difference)"
Go into Layer 3's FX Styles. Under Blending Options, all the way at the bottom you'll find "Blend if:"
Set this to Gray and slide the "This layer:" markers until it says 0 0.
Voila. You have the mask to put on your original Layer 1 that eliminates all pixels with the same information.

Related

Apply 3D mask to 3D mask, background is white

I try to apply a binary mask on a 3D image by multiplying them. It, however, returns an image with a white background, rather than black (what I would expect since the binary mask is 0 and 1, where all of the background pixels equal 0).
First I load the 3D scan/image (.nii.gz) and mask (.nii.gz) with nibabel, using:
scan = nib.load(path_to_scan).getfdata()
mask = nib.load(path_to_mask).getfdata()
Then I use:
masked_scan = scan*mask
Below visualized that when applying another mask, the background is darker..
enter image description here
Below visualized what they look like in 3D slicer as volume.
enter image description here
What am I missing? Aim is to have a black background...
I also tried np.where(mask==1, scan, mask*scan)

How can I find the amount of pixels in part of an image?

I have an image and I want to see how many pixels are in different parts of the image. Is there a software I can use to do this?
In Gimp, the "Histogram" dialog applies to the selection, so the pixel count displayed is the pixels in the selection (weighted by their selection level):
In the image below the selection covers the black circle which has a 100px radius. The Pixels value is close to 100²*Pi (314000 instead of 314159).
The Count is the number of pixels between the two values indicated by the handles at the bottom of the histogram.
Of course the selection can have any shape and be obtained with various tools.
I assume PS has something equivalent.

conv2d on non-rectangular image in Tensorflow

I have dataset of images which are half black in a upper triangular fashion, i.e. all pixels below the main diagonal are black.
Is there a way in Tensorflow to give such an image to a conv2d layer and mask or limit the convolution to only the relevant pixels?
If the black translates to 0 then you don't need to do anything. The convolution will multiply the 0 by whatever weight it has so it's not going to contribute to the result. If it's not you can multiply the data with a binary mask to make them 0.
For all black pixels you will still get any bias term if you have any.
You could multiply the result with a binary mask to 0 out the areas you don't want populated. This way you can also decide to drop results that have too many black cells, like around the diagonal.
You can also write your own custom operation that does what you want. I would recommend against it because you only get a speedup of at most 2 (the other operations will lower it). You probably get more performance by running on a GPU.

VBA: Set transparency level in cell

I have a pie chart and I would like to put a legend with the same colors in the cells.
The Pie chart has a transparency of 22.5%.
If I use the same RGB combination when I set the color in the cell, this color is different because it is much darker.
'___COLORS FOR LEGEND PIE____
If inc < 14 Then ws.Cells(rx + inc, 19).Interior.Color = RGB(colorR, colorG, colorB)
Is there a way to set transparency? I know it is possible in the charts.
If there is no way to set transparency, how canm I change my RGB code to adapt to a transparency of 22.5%?
The answer is you can't set the transparency of a cell in Excel.
This is because the Range.Interior.Color only supports the RGB and not RGBA. A - stands for ALPHA which is used for transparency.
One way around it (which I wouldn't recommend) would be to insert a shape (say a rectangle) over the cell and set its transparency to match the already transparent chart but if you have a lot of data this will definitely slow things down and if your data chages often or you are inserting/removing rows this will just be a real pain in the back bone.
Another idea would be to go online and find 2 sets of colors RGBA and its somehow matching RGB equivalents. I have seen such solutions before but never tried it myself so I can't give you any tips on it.

Lesscss: Why spin(#000,180) is returning #000?

I need to know how to get the inverse color by lesscss.
Example: I have #000, i need #FFF.
And i need the detail explanation of spin(). And necessary links where i can see a color wheel where i can understand how spin() works.
Thanks.
Why it is not working as you expect
The spin() function only deals with hue (color), not value (grey scale changes are a value change). Take a look at Figures 9 and 10 on this page from North Carolina State University's site. Those figures help show the difference. The spin() function is rotating only in the two dimensional space of the hue circle of color, not along the axis of the third dimensional space dealing with saturation; i.e. the gray scale itself, which is what differentiates white from black, both of which have no color saturation).
This is why on the LESS site we read of spin() (emphasis added):
Note that colors are passed through an RGB conversion, which doesn't
retain hue value for greys (because hue has no meaning when there is
no saturation)
And
Colors are always returned as RGB values, so applying spin to a grey
value will do nothing.
Getting what you want (Color Inversion)
See #seven-phases-max's answer.
The spin function changes the Hue property of a colour. Shades of grey (incl. white and black) are achromatic colours (i.e. they have the same "undefined" hue value).
To simply invert a colour use either difference function:
difference(white, #colour)
or the simple colour arithmetic:
(#fff - #colour)