Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make a selection on a 16bit grayscale of only the darkest pixelspixels
#1
So there is an issue perhaps due to hardware limitations and large images that I cannot click on a pixel of pure black, 0, and use Select By Color with a threshold of 1 to create a selection of all pixels between 0 and 1. I need to select all those pixels in the image with shades of 0.7 and 0.9 for instance. And once selected use the bucket fill to make them all equal to 0

Or at least I need to be able to make all of those pixels between 0 and 1  = 0 by another method. So is there another option open to me? How can I achieve this?  

Thanks
Reply
#2
It would still be beneficial for a clip from your problem image, 16 bit grayscale in Gimp .xcf format. The forum has a 2 MB file size limit.

However, this might work (or not) with your large image, it will consume a lot of resources.

This is a 30 second animation of the sequence. https://i.imgur.com/nlSe0rA.mp4
I have base layer (your image) which contains 2 areas of just-off pure black sp1 hex 000002 and sp2 hex 000004
Add this to a layer group and put a black layer over it and change the layer mode to divide.
Now in the layer group colour select the black. That is your selection, delete the black layer, merge the layer group.
Reply
#3
(04-17-2024, 03:06 PM)rich2005 Wrote: It would still be beneficial for a clip from your problem image, 16 bit grayscale in Gimp .xcf format. The forum has a 2 MB file size limit.

However, this might work (or not) with your large image, it will consume a lot of resources.

This is a 30 second animation of the sequence.  https://i.imgur.com/nlSe0rA.mp4
I have base layer (your image) which contains 2 areas of just-off pure black sp1 hex 000002 and sp2 hex 000004
Add this to a layer group and put a black layer over it and change the layer mode to divide.
Now in the layer group colour select the black. That is your selection, delete the black layer, merge the layer group.

So I have uploaded a small area from the whole.

But when I put the Black layer in Divide mode it goes a bit weird, or at least not the same as what I expected.

It might be the notation throwing me, so I am trying to select up to RGB(1.0,1.0,1.0) and lessor shade down to 0, which seems to equate to hex 030303.
Did I get that right?


Attached Files
.xcf   test.xcf (Size: 131.46 KB / Downloads: 76)
Reply
#4
Sorry, I am being very dim at the moment.

You want to select pure black hex 000000 through to off-black hex 030303 so you can fill with pure black.....leaving what ?

   
Reply
#5
Possible solution:

* Duplicate layer
* Threshold top layer so that the few very dark turn black and the rest turns white
* Set the layer to "Darken only"

   
Reply
#6
Ok, back from the land of feeling horribly unwell.

Another thought and possibility.  Change the relationship between pixel values to give something that makes colour select easier.

Duplicate layer
You can use levels or curves but an easy one is Colors -> Auto -> Equalise
Using the Color select tool and the draw mask option, clicking in the image and dragging left / right automatically adjusts the threshold and gives a visual (magenta) for the selection.

   

This yet another little demo:  https://i.imgur.com/rv3KlXF.mp4 and I have attached your 16 bit clip with a selection in place , is it anything like you need ?


Attached Files
.xcf   test-01.xcf (Size: 194.55 KB / Downloads: 55)
Reply
#7
(04-17-2024, 05:57 PM)rich2005 Wrote: Sorry, I am being very dim at the moment.

You want to select pure black hex 000000 through to off-black hex 030303 so you can fill with pure black.....leaving what ?

Leaving any pixels above 030303 as they already are.  pixels with values 040404 remain at 040404 for instance

(04-17-2024, 07:58 PM)Ofnuts Wrote: Possible solution:

* Duplicate layer
* Threshold top layer so that the few very dark turn black and the rest turns white
* Set the layer to "Darken only"

The rest should not turn white but stay on whatever their current gray shade is.

(04-18-2024, 07:39 AM)rich2005 Wrote: Ok, back from the land of feeling horribly unwell.

Another thought and possibility.  Change the relationship between pixel values to give something that makes colour select easier.

Duplicate layer
You can use levels or curves but an easy one is Colors -> Auto -> Equalise
Using the Color select tool and the draw mask option, clicking in the image and dragging left / right automatically adjusts the threshold and gives a visual (magenta) for the selection.



This yet another little demo:  https://i.imgur.com/rv3KlXF.mp4 and I have attached your 16 bit clip with a selection in place , is it anything like you need ?

The problem is the threshold is not going below 15 in your example, and the app was dying when the threshold was set at 1. On the clip size Select By Color works at a threshold of 1. It is when the image is larger that it breaks. Yes I have used the Drawmask function.

Edit: It got me wondering if the extra burden of the drawmask might have hamstrung this, and turning it off, indeed Select By Color works at a threshold of 1 on the large image is working. Yippee. Lets just hope I don't have to go back to 16321x16321 anytime soon.

For anybody that's wondering this is a weight map of streams generated from a Gaea landscape to be used in UE5.4 ... Thanks for your help guys.
Reply
#8
(04-19-2024, 02:38 PM)andyseabrook Wrote: The rest should not turn white but stay on whatever their current gray shade is.

Which the whole purpose of the "Darken only" mode set to the thresholded layer. The black pixels are darker than those of the original image so the composite image uses the black pixels, the white pixels are lighter than those of the original image so the composite image uses these original pixels.
Reply


Forum Jump: