Post Reply 

Make alpha channel from another image

Jul 27, 2011, 15:53
Post: #1
Make alpha channel from another image
I have an existing (grayscale) image that I want to make into the alpha channel for another image. Is this possible?
Find all posts by this user
Quote this message in a reply
Jul 27, 2011, 16:06
Post: #2
RE: Make alpha channel from another image
- Open other image
- "File/Open as layers" your alpha channel image
- Create a selection on that layer ("Layer/Transparency/Alpha to selection" if transparent, or select by color if B&W, for instance)
- Back to the layer of your original image
- "Layer/Mask/Add layer mask", initialize to selection
- "Layer/Mask/Apply layer mask"

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Jul 27, 2011, 21:33
Post: #3
RE: Make alpha channel from another image
(Jul 27, 2011 16:06)ofnuts Wrote:  - Open other image
- "File/Open as layers" your alpha channel image
- Create a selection on that layer ("Layer/Transparency/Alpha to selection" if transparent, or select by color if B&W, for instance)
- Back to the layer of your original image
- "Layer/Mask/Add layer mask", initialize to selection
- "Layer/Mask/Apply layer mask"

Many thanks for your swift reply. I've done some tests, but unfortunately the method introduces substantial changes to the grayscale image which I'm trying to avoid.

The images I'm using are derived from the NASA SRTM data in which each pixel represents the height above sea-level of a 3-arcsecond square of the earth's surface. The resulting images have very subtle gradations of (see small sample attached). This subtlety is lost when the 'alpha to selection' function is called.

Oh well - I'll keep at it.

   
Find all posts by this user
Quote this message in a reply
Jul 27, 2011, 21:50 (This post was last modified: Mar 8, 2012 18:45 by ofnuts.)
Post: #4
RE: Make alpha channel from another image
(Jul 27, 2011 21:33)mike_m Wrote:  
(Jul 27, 2011 16:06)ofnuts Wrote:  - Open other image
- "File/Open as layers" your alpha channel image
- Create a selection on that layer ("Layer/Transparency/Alpha to selection" if transparent, or select by color if B&W, for instance)
- Back to the layer of your original image
- "Layer/Mask/Add layer mask", initialize to selection
- "Layer/Mask/Apply layer mask"

Many thanks for your swift reply. I've done some tests, but unfortunately the method introduces substantial changes to the grayscale image which I'm trying to avoid.

The images I'm using are derived from the NASA SRTM data in which each pixel represents the height above sea-level of a 3-arcsecond square of the earth's surface. The resulting images have very subtle gradations of (see small sample attached). This subtlety is lost when the 'alpha to selection' function is called.

Oh well - I'll keep at it.
For this kind of image:
- In original image: Layer/Mask/Add layer mask and init to anything (white is OK)
- Load greyscale image as layer in same image or in another image.
- Select all & copy to clipboard
- Back to original image layer, make sure it's selected, you can also check that Layer/Mask/Edit layer mask is still set
- Edit/paste: this creates a floating selection
- Layer/Anchor layer: moves floating selection to layer mask
- Apply layer mask

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Jul 27, 2011, 22:01
Post: #5
RE: Make alpha channel from another image
Wow! that was quick! Thanks, I'll try it.
Find all posts by this user
Quote this message in a reply
Jul 28, 2011, 09:09 (This post was last modified: Mar 8, 2012 18:47 by ofnuts.)
Post: #6
RE: Make alpha channel from another image
Quote:For this kind of image:
- In original image: Layer/Mask/Add layer mask and init to anything (white is OK)
- Load greyscale image as layer in same image or in another image.
- Select all & copy to clipboard
- Back to original image layer, make sure it's selected, you can also check that Layer/Mask/Edit layer mask is still set
- Edit/paste: this creates a floating selection
- Layer/Anchor layer: moves floating selection to layer mask
- Apply layer mask

Many thanks - worked a treat. You obviously know Gimp as well as Clapton knows his Strat!
Find all posts by this user
Quote this message in a reply
Jul 28, 2011, 14:05
Post: #7
RE: Make alpha channel from another image
Clapton is way better with his guitar... I just happen to know a few chords on Gimp Smile

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Mar 8, 2012, 18:11
Post: #8
RE: Make alpha channel from another image
(Jul 28, 2011 14:05)ofnuts Wrote:  Clapton is way better with his guitar... I just happen to know a few chords on Gimp Smile
The only problem with this procedure is that the floating selection is created with Edit/paste, not Edit/copy. Being a literalist when it comes to following directions, that threw me for a minute.
Find all posts by this user
Quote this message in a reply
Mar 8, 2012, 18:48
Post: #9
RE: Make alpha channel from another image
(Mar 8, 2012 18:11)PoorDave Wrote:  
(Jul 28, 2011 14:05)ofnuts Wrote:  Clapton is way better with his guitar... I just happen to know a few chords on Gimp Smile
The only problem with this procedure is that the floating selection is created with Edit/paste, not Edit/copy. Being a literalist when it comes to following directions, that threw me for a minute.
Yes... the previous user didn't report it though... Fixed all previous posts for the next poor soul :-) Found this through Google?

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Mar 9, 2012, 00:58 (This post was last modified: Mar 9, 2012 00:59 by PoorDave.)
Post: #10
RE: Make alpha channel from another image
Actually, I just found it by shuffling through the forums looking for interesting tips-- shows you how Asperger's I am, I guess. BTW, now that it's corrected, please feel free to delete this part of the thread, I won't be offended, lol. Also, you're doing great work here, extremely helpful, thanks very much.
Find all posts by this user
Quote this message in a reply
Mar 9, 2012, 07:20
Post: #11
RE: Make alpha channel from another image
Let's keep it as a warning to future users Smile

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Mar 9, 2012, 14:16
Post: #12
RE: Make alpha channel from another image
Ooops! Sorry I didn't notice the typo when you originally posted it. I guess I must have done Ctrl-V without thinking about it.

BTW, in the end I wrote a stand-alone tool to copy channels from one image to another - not the world's fastest code but quicker than manipulating layers in Gimp when running it on a lot of images.
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Image Map - update existing image w/links Norkuvich 1 192 Sep 18, 2017 08:16
Last Post: paynekj
  How to remove shaky camera ghost image? ianpwilliams 4 1,599 Aug 12, 2017 13:47
Last Post: Elizabeeth
  How to extend an Image from side to side softening the hard edge of image Flesh 2 265 Jul 21, 2017 06:21
Last Post: Flesh
  Image Quality Degradation Issue dedoubleu 2 331 Jun 7, 2017 06:37
Last Post: ythgilb
  Color alpha function and its current errors Fuse809 0 270 Oct 11, 2014 03:53
Last Post: Fuse809

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS