Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How use a png with a transparent background as a mask
#1
I am trying to add an arrow pointer onto a picture (and plan to do a lot). I have added a png of the arrow, which I know has a transparent background, to a second layer. I have tried to set it up as a mask, but dont understand the finer details - it just stays as a complete rectangle. NB: Have successfully re-sized it & am trying to rotate it. I am new to GIMP, but IT competent.
Reply
#2
(02-05-2021, 06:31 PM)daveq Wrote: I am trying to add an arrow pointer onto a picture (and plan to do a lot). I have added a png of the arrow, which I know has a transparent background, to a second layer. I have tried to set it up as a mask, but dont understand the finer details - it just stays as a complete rectangle. NB: Have successfully re-sized it & am trying to rotate it. I am new to GIMP, but IT competent.

I didn't quite understand, if you have an arrow with a transparent background you wouldn't need to create masks.

But anyway to create a mask it would be something like:

1- With the arrow layer selected, click Layer - Transparency - Alpha to Selection
2- Right-click on this layer and in the pop-up that appears choose Add layer mask - then select Selection

On the other hand, I suggest reading the posts at https://www.gimp-forum.net/Thread-Arrow-...1#pid17481 with suggested scripts for creating arrows.
Reply
#3
(02-05-2021, 06:54 PM)Krikor Wrote:
(02-05-2021, 06:31 PM)daveq Wrote: I am trying to add an arrow pointer onto a picture (and plan to do a lot). I have added a png of the arrow, which I know has a transparent background, to a second layer. I have tried to set it up as a mask, but dont understand the finer details - it just stays as a complete rectangle. NB: Have successfully re-sized it & am trying to rotate it. I am new to GIMP, but IT competent.

I didn't quite understand, if you have an arrow with a transparent background you wouldn't need to create masks.

But anyway to create a mask it would be something like:

1- With the arrow layer selected, click Layer - Transparency - Alpha to Selection
2- Right-click on this layer and in the pop-up that appears choose Add layer mask - then select Selection

On the other hand, I suggest reading the posts at https://www.gimp-forum.net/Thread-Arrow-...1#pid17481 with suggested scripts for creating arrows.
Using scripts, which I havent ever done, seems like a complex way to resolve the issue. I presumed with a transparent png  it would be a simple mask task. I have used the attached png in a video editor using chroma key and a colour-picker off the image, which to me confirms it does have a transparent background (but I may be wrong!). Could you try my arrow and see if you can make it work?
Reply
#4
(02-05-2021, 09:32 PM)daveq Wrote: Using scripts, which I havent ever done, seems like a complex way to resolve the issue. I presumed with a transparent png  it would be a simple mask task. I have used the attached png in a video editor using chroma key and a colour-picker off the image, which to me confirms it does have a transparent background (but I may be wrong!). Could you try my arrow and see if you can make it work?
Yes, I could, but where are your arrow?
Reply
#5
(02-05-2021, 09:32 PM)daveq Wrote: Using scripts, which I havent ever done, seems like a complex way to resolve the issue. I presumed with a transparent png  it would be a simple mask task. I have used the attached png in a video editor using chroma key and a colour-picker off the image, which to me confirms it does have a transparent background (but I may be wrong!). Could you try my arrow and see if you can make it work?
Yes, I could, but where are your arrow?

Attached now [attachment=5571] ,  I think
Reply
#6
(02-06-2021, 12:15 AM)daveq Wrote:
(02-05-2021, 09:32 PM)daveq Wrote: Using scripts, which I havent ever done, seems like a complex way to resolve the issue. I presumed with a transparent png  it would be a simple mask task. I have used the attached png in a video editor using chroma key and a colour-picker off the image, which to me confirms it does have a transparent background (but I may be wrong!). Could you try my arrow and see if you can make it work?
Yes, I could, but where are your arrow?

Attached now,  I think

Not yet...  Dodgy
Reply
#7
Quote:I am trying to add an arrow pointer onto a picture (and plan to do a lot). I have added a png of the arrow, which I know has a transparent background, to a second layer. I have tried to set it up as a mask, but dont understand the finer details - it just stays as a complete rectangle. NB: Have successfully re-sized it & am trying to rotate it. I am new to GIMP, but IT competent.

Various ways. 
You can add as a layer, and scale / move / rotate the layer. Another arrow requires another layer.

Use a script / plugin to create the arrow. That is probably the most flexible way and generally produces the best results.

Use your png arrow and create a brush. 
Make it black on a white background, set Image -> Mode to Greyscale and export as a somename.gbr to your brushes folder. C:\Users\"yourname"\AppData\Roaming\GIMP\2.10\brushes
Edit: For a greyscale brush the white base is transparent and black takes the FG colour @ 100% opacity. Various grey values result in reduced opacity.


   

Refresh the brushes (or restart Gimp) and use the new brush as a 'stamp'.  Uses the current FG colour. Some scope for resizing , rotating using the brush tool sliders, but note this can degrade the stamp due to interpolation.

   
Reply
#8
I understand GIMP much better now. Discovered my arrow that I downloaded off the web is not transparent at all. So have created one. Now adding that as a layer works as expected.

I only need to do a few at the moment. If/when the volume ramps up I will try out your excellent sounding method
Reply


Forum Jump: