It is currently Wed Sep 23, 2026 2:50 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Alpha to Selection not selecting properly?
PostPosted: Wed Aug 29, 2018 10:23 pm  (#1) 
Offline
GimpChat Member

Joined: Jun 06, 2018
Posts: 11
GIMP Version: 2.10.6
Operating System: Windows
GIMP Experience: Experienced User



So I was colouring my project recently and I use Alpha to Selection to select the base layer for colouring the other layers without going outside the lines. But when I pulled back the lineart by accident I noticed a border...
Image
I tried selecting the layer by Alpha to Selection again but it didn't change the selection at all.

What Alpha to Selection is suppose to do is select not just the solid pixels but also partially select the semi-transparent pixels as well. Something like this:
Image
(Using Lock Alpha Channel to get the effect Alpha to Selection is suppose to do.)
There's not suppose to be a border!
This wasn't a problem in 2.8!


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Alpha to Selection not selecting properly?
PostPosted: Thu Aug 30, 2018 1:38 am  (#2) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
Alpha-to-selection partially selects the pixels on the border since they are partially opaque. So when you use that selection elsewhere, the corresponding pixels are partially painted.

Maybe you are using the wrong technique? If you explain a bit more what you are doing we could come up with a more correct one.

_________________
Image


Top
 Post subject: Re: Alpha to Selection not selecting properly?
PostPosted: Thu Aug 30, 2018 8:50 am  (#3) 
Offline
GimpChat Member

Joined: Jun 06, 2018
Posts: 11
ofnuts wrote:
Alpha-to-selection partially selects the pixels on the border since they are partially opaque. So when you use that selection elsewhere, the corresponding pixels are partially painted.

Maybe you are using the wrong technique? If you explain a bit more what you are doing we could come up with a more correct one.


Yes, I know... But in 2.10 it doesn't select the partially opaque pixels at all because I can't colour them like I should (again, should look like the bottom picture). There shouldn't be a border.

Just as an experiment I reinstalled 2.8 to test it out and low and behold when I used Alpha to Selection on one layer and coloured on a new layer on top there was no border issue. I could colour the semi-transparent pixels the same colour as the new layer. Again, like the bottom picture.

All I do is right click on the base layer for colouring and click Alpha to Selection like I've always done. Not sure how to explain any further :/


Top
 Post subject: Re: Alpha to Selection not selecting properly?
PostPosted: Thu Aug 30, 2018 9:17 am  (#4) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
Can't look for an explanation unless you explain a bit more what you do.

_________________
Image


Top
 Post subject: Re: Alpha to Selection not selecting properly?
PostPosted: Thu Aug 30, 2018 10:18 am  (#5) 
Offline
GimpChat Member

Joined: Jun 06, 2018
Posts: 11
ofnuts wrote:
Can't look for an explanation unless you explain a bit more what you do.

Here, I made a video:
https://youtu.be/yirXZ7ZfdEI


Top
 Post subject: Re: Alpha to Selection not selecting properly?
PostPosted: Thu Aug 30, 2018 2:41 pm  (#6) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
Well the problem exists also in 2.8 but is less visible. Basically:

- the edge of your white layer are smooth, which is achieved with edge pixels that are partially opaque
- Alpha to selection translates this to a partial selection. The selection is really the opacity of whatever you paint, so if you were to bucket fill your new layer with white you would get an exact copy of the white layer
- When you paint in brown the edge pixels are painted in partially opaque brown, so a little of the white below shows through.

OK, on 2.10 it is more visible, and there could be a problem with the generated selection. But I still think you aren't using the right technique, with some color combinations you would also have a visible rim in 2.8.

_________________
Image


Top
 Post subject: Re: Alpha to Selection not selecting properly?
PostPosted: Thu Aug 30, 2018 4:50 pm  (#7) 
Offline
GimpChat Member

Joined: Jun 06, 2018
Posts: 11
ofnuts wrote:
Well the problem exists also in 2.8 but is less visible. Basically:

- the edge of your white layer are smooth, which is achieved with edge pixels that are partially opaque
- Alpha to selection translates this to a partial selection. The selection is really the opacity of whatever you paint, so if you were to bucket fill your new layer with white you would get an exact copy of the white layer
- When you paint in brown the edge pixels are painted in partially opaque brown, so a little of the white below shows through.

OK, on 2.10 it is more visible, and there could be a problem with the generated selection. But I still think you aren't using the right technique, with some color combinations you would also have a visible rim in 2.8.

Oh, okay, I get it now.

What I want is something like Paint Tool SAI's Clipping Group:
https://youtu.be/wQkOjevH2Wg
Where you can draw on a layer and then on a second layer you can draw over it without going outside the border. Or even make it disappear. As you can see the bottom layer doesn't show through at all. But Gimp as far as I know doesn't have an equivalent feature. I use Alpha to Selection as an alternative.

Quote:
But I still think you aren't using the right technique

Still not sure what you're talking about. I only use a mouse to draw on gimp since Gimp can't sense my tablet pen's pressure at all, no matter what I do.

If you were going for what I am going for what would you do differently?


Top
 Post subject: Re: Alpha to Selection not selecting properly?
PostPosted: Thu Aug 30, 2018 5:35 pm  (#8) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
Further check: in both versions:

- create a 200x200 image (8-bit gamma for 2.10)
- set up guides, and make a circle selection,
- bucket fill selection in a new transparent layer, export as InitialSelection-2.xx.png
- Select>None; Alpha-select the layer, and hide it
- Bucket fill selection in a new transparent layer, export as AlphaSelection-2.xx.png

For both versions, compare the initial selection with the alpha selection: load the two PNG as layers, set top to difference mode, new layer from visible and check the histogram, all pixels at 0, so alpha selection is exactly what it is supposed to be.

Now, compare the initial selections of both versions. No need for the histogram, in difference mode there is a visible circle, so the circle selections are not exactly identical.

Comparing the histograms of both versions:
+-----------+-------+-------+
|  value    |  2.08 |  2.10 |
+-----------+-------+-------+
|     0     | 19856 | 19856 |
+-----------+-------+-------+
|  1<=x<=128|   252 |   104 |
+-----------+-------+-------+
|128<=x<=255|   224 |   372 |
+-----------+-------+-------+
|    255    | 19668 | 19668 |
+-----------+-------+-------+


- Both version create exactly the same number of fully white or black pixels
- They also create the same number of grey/edge pixels
- However the 2.10 edge pixels are significantly more transparent than in 2.8

This extra transparency in 2.10 explains your problem I think. Since I would expect th edge pixels to be statistically centered around 128, I would think that this is a problem with 2.10.

_________________
Image


Top
 Post subject: Re: Alpha to Selection not selecting properly?
PostPosted: Thu Aug 30, 2018 5:39 pm  (#9) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
You should look at the "Behind" mode of paint tools, it "fills to opacity" the pixels with the color. On a fully opaque pixel, it does nothing, on a transparent pixel it works as in "normal" mode, but on a partially transparent pixels, if makes them opaque exactly as if it painted on the back of the layer, which is exactly what you want to do it you want to fill an area delimited by smooth edges (if you want to cover your *ss, fuzzy select the area, then Select>Grow by a couple of pixels).

_________________
Image


Top
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group