I have two images. I'd like to slice one image based on the dimensions of the other image. E.g. I have a triangular image and a regular image, I want to put the triangle image over the regular image and get an image of what is under the triangle image.
Images are always rectangular - they may look like they have otehr formats doing to all parts out of a certain area are transparent.
So, what you want is to carry the transparency information of the second image to the first image. One way to do this, once you have the second image as a layer above the original image in the same GIMP document is:
- click on the second image, on the layers dialog (
ctrl + l), right click and pick
Create layer maskon the layer's context menu. On the following dialog choose
Layer's Alpha Channel. You have now a mask wich is a B&W representation of the trasnparent areas as the Layer mask - GIMP allows you to copy this as you do with the ordinary pixels of a layer. You can see a thumbnail for the mask visible on the Layers dialog.
Edit->copy(this will copy the mask pixels to the clipboard). Ensure you have no selection active on the image before doing it.
- hide your second image (click on the eye icon), select your first image, and, again, click on the
Create layer mask.... Pick "White (full opacity)" 1.
Layer>Anchor(or just click on the
This will copy the transparency information to your first image - now just export your image to png, and you are done.
there is a similar answer here as well: Gimp — combine alpha from one layer, with rgb image of another