# Thread: Clipping Images Instead Of Clipping Geometry.

1. ## Clipping Images Instead Of Clipping Geometry.

I'm not understanding how to clip away parts of a projected image without clipping away parts of an object it's projected onto. The diagram attached illustrates this. If you take a polygon (A) and project a color channel onto it (B) along with a corresponding alpha image consisting of black for fully opaque and white (green just for illustration) for fully transparent (image not shown) the rest of the marble rectangle disappears (C). That's what is supposed to happen and I've used this many times in many projects. However, I want to clip only the image and leave the geometry unaffected by the image mask (D). I thought that using nodes would allow me to do this but, somehow, it's just doing the same thing as the standard "pre-nodes" surfacing tools. There are at least three work-arounds to this, and I've used each of them from time to time but they all have draw-backs. (1) -- Have the marble and the logo in the same image. (2) -- Create a round polygon inside the square one and project the logo onto it. (3) -- Create two polygons on the same plain, then put a transparency map on the marble to produce an apparent hole, and then apply a negative of that map on the logo -- this eliminates any "Z" conflict because where any spot on the marble polygon is opaque the same spot on the logo polygon is transparent, and vice versa.

2. Did you try using Color Mixer node.. ?

Plug 1st image node to Bg Color, 2nd image node to Fg Color in Mixer,
plug alpha mask image node to Opacity.
If alpha mask = 0% (black), output from mixer will be from Bg image node,
if alpha mask = 100% (white), output from mixer will be from Fg image node.

3. Thanks. It's interesting, however, it's still not as flexible as using a slider or numerical input to change the position of one image over another. That's because if (in my example) I wanted to move only the logo a little to the left (let's say) I would have to make a change to the foreground image (to increase the canvass size of the logo background) to allow for this. Anyway, I haven't checked out the mixing node yet. I'll experiment with it and I will surely make a reply post this coming weekend.

4. Add two Image nodes (or one Image node and procedural, like I did). Image with alpha has plugged something to Bg Color input.

They will mix together, based on alpha channel of image.

5. Do you want it to have it smaller and positioned?

Use U Tiling Reset and V Tiling Reset.

6. Be sure to use VPR to observe the Surface if alpha / masking is included. The Texture Shaded Solid mode doesn't apply the alpha channel.

If that doesn't work, you might also try an image format other than PNG. I've found that masks / alpha channels in PNG files are quite strange. If you can, try using a TIFF or TGA format for images containing alpha data. Or figure out what transparency in PNG files works with LW.

Sample LW2019 attached with a TGA file containing an alpha channel, which does what I think you want.

When the Position of the LWLogo image is moved in the Texture channel, the alpha channel goes with it:

mTp

7. I've gotten more suggestions than I was counting on but it takes time for me to fully understand each technique. I experimented with the Mixer node and the attached diagram shows my first result. As you can see, all five node thumbnails are completely black which is an issue in itself because the images for the three image nodes are loaded. There is probably a simple reason for this but, firstly, I want to know if the setup is correct. The marble image (which is an image, not a textural) is supposed to cover the gray polygon and is plugged in the "Bg" of Mixer. Next, the Coca-Cola logo image is plugged into the "Fg" of Mixer. Lastly, the mask (an 8-bit image) is plugged into Mixer Opacity to clip the green areas away from the logo. All three images are BMP format (two 24-bit and one 8-bit mask, and I should get the composite image as shown in the Mixer node (as well as in the Surface thumbnail). If my node configuration is correct then why is it showing black thumbnails and no effect on my gray polygon?

8. I think the Alpha channel in your BMP files is broken. There are some online articles about PhotoShop breaking alpha support in BMP files. You might try saving as TIFF or TGA.

Attached is a LW2019.1.4 scene, ImageWithB&WOpacity_Mixer_LWLogoWithMarbleBkg.zip, which has the same node setup you posted, which works fine for me. I disabled the Alpha channel in all my images using the Edit Image, and had to invert the Black&White opacity mask (White is opaque, Black is transparent).

The setup is:

If you disable the Alpha channel in your images and suddenly the thumbnails appear, it would seem to verify that the Alpha channel is broken in your images (or inverted?).

If your Coca Cola image has a valid Alpha mask the node network can be simpler, with the marble Image texture being fed directly into the Coca Cola Image's Bg Color and the mask will be correctly applied:

The simpler node setup allows the placement of the image to be changed while the Alpha channel follows along automatically. In the case of this sample animation, the X position of the image is oscillated over time:

ImageWithAlphaLayer_LWLogoWithMarbleBkg.mov MOV file

I've also attached the sample scene for this (ImageWithAlphaLayer_LWLogoWithMarbleBkg.zip) with the images containing valid Alpha channels.

mTp

9. I tested the TGA image format in an image node and I got the same results as when I used BMP. I loaded a marble image into the node, and it properly appears in the parameters box on the left. The polygon to be wrapped has only X,Y dimensions so the image is projected in the Z axis and sizing is automatic, however, no node thumbnail is shown. The rest of the techniques offered are still confusing to me. I'd like someone to take my three test images to try to produce the result I'm looking for and show me a screen shot of the setup used for it. That's the best way for me to see how it's done. All you need to do is make one square polygon of any size and use my images. All are 505 pixels square. Marble.bmp is the background image, Coca-Cola.bmp is the foreground image and mask.bmp cuts away the green portions of the logo.

10. Works fine for me on LW 2019.1.5 using your uploaded BMP images:

The B&W mask image has its Color inverted in the Image node since White makes the Fg Color opaque:

What version of LW are you using?

mTp

11. Originally Posted by icon kid
...however, no node thumbnail is shown...
Could be your refresh option in node editor, is it set to automatic?

Denis.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•