Messages 1 - 45 of 48
First | Prev. | 1 2 | Next | Last |
Ramlyn
![]() |
I would like to sel ect a color range in an image. For example, from pink to dark red. Then deleting only these color areas fr om the image or using only these color areas. It is easy to do in Photoshop, but how to do using only Filter Forge?
|
|
Posted: August 23, 2015 7:43 pm | ||
Rachel Duim
![]() |
Here is a snippet that allows you to pick a single color, you can adapt this for your uses. How it works: The picked color is subtracted from the image. This then gives you a range of colors from -1 to 1. The colors you want to keep are near 0. So the range is then converted to 0 to 1 with the absolute component. Then inverted, put through a threshold component, which sets the color threshold and feathering amount of the mask.
Color Range.ffxml Math meets art meets psychedelia. |
|
Posted: August 24, 2015 12:37 am | ||
Ramlyn
![]() |
Thanks so much, Rick.
![]() I check it and see how to adapt it. |
|
Posted: August 24, 2015 8:59 am | ||
Ramlyn
![]() |
Hummm.... It seems difficult to control.
It has the tendency to refuse many lighter or darker variations of the color we choose, and instead to accept partially completely different colors. |
|
Posted: August 24, 2015 1:02 pm | ||
Rachel Duim
![]() |
Set the threshold to 90 and the feathering to 5. Then go to the Match Color and change colors and watch if it works. It works for me. If not, please show me an example if you could.
It may be that you want more of a color match than a brightness match. Might require looking at the separate channels in the code. UPDATE: I am looking at using Euclidean distance to compute the color range. This is the distance between each pixel and the "match" color (in 3d space, RGB). If I have time today I will post a less sensitive (and more correct) version using Euclidean distance. Needed to learn about this anyway. Math meets art meets psychedelia. |
|
Posted: August 24, 2015 1:23 pm | ||
Rachel Duim
![]() |
Here is the next attempt at a color picker using Euclidean distance. The best values seem to be between 50-90 for the Color Threshold and 5 for Color Feathering. Here is a link to a color chart that is helpful in testing:
![]() UPDATE: Your request is for a 2 color range. After some thought, this is the Euclidean distance between a line (defined by the 2 colors in 3d RGB space) and the pixel value of the image (in 3d RGB space). I'll work that out and post a snippet later. Euclidian Color Picker.ffxml Math meets art meets psychedelia. |
|
Posted: August 24, 2015 3:03 pm | ||
Rachel Duim
![]() |
A lot more math to do the 2 color version, it may have to wait...
![]() Math meets art meets psychedelia. |
|
Posted: August 24, 2015 6:18 pm | ||
Ramlyn
![]() |
Thanks Rick.
![]() Yes, the Euclidean Color Picker works better. But it still goes to pick colors in strange way. A simple example. If you set the Match Color as 0C494A, the Feathering at 5, you can see that until 87-90, it does pick completely different colors ( as green and brown ), missing instead more similar ones ( light blue ). It would be useful that, when we select a Match Color, it could take the whole variation of saturation and brightness of that color, except for white and black, with the chance to make this selection more or less wide. Instead if it picks also hue variations, it clearly misses the selected color. I don't know if my explanation is good. |
|
Posted: August 25, 2015 4:14 pm | ||
Rachel Duim
![]() |
It sounds like it is doable. I suspect I need to work in the HSB color space instead of RGB, maybe interpreting each channel separately. Computing the distance in 1 dimension is a whole lot easier
![]() Math meets art meets psychedelia. |
|
Posted: August 25, 2015 4:38 pm | ||
Rachel Duim
![]() |
A lot easier to code than the Euclidean method, everything is in 1 dimension, about my speed
![]() ![]() UPDATE: Except for the bug I just found in it, have withdrawn it. Looking at it now. Math meets art meets psychedelia. |
|
Posted: August 25, 2015 5:26 pm | ||
Skybase
![]() |
Very nice work!
![]() |
|
Posted: August 25, 2015 8:32 pm | ||
Rachel Duim
![]() |
Ok, here is the next version, an HSB Color Picker. This seems to work the best with Hue Treshold set to between 5-15, and Saturation and Brightness Threshold set to 50.
HSB Color Picker.ffxml Math meets art meets psychedelia. |
|
Posted: August 25, 2015 9:35 pm | ||
Ramlyn
![]() |
Great! This is surely the best one among the three you made.
![]() Thanks Rick! ![]() |
|
Posted: August 26, 2015 9:44 am | ||
Rachel Duim
![]() |
Do you think this should be released as a snippet?
Math meets art meets psychedelia. |
|
Posted: August 26, 2015 1:40 pm | ||
Ramlyn
![]() |
Yes, I think so. If you let it only here, after a while, it will become hard to find.
|
|
Posted: August 27, 2015 3:55 am | ||
Rachel Duim
![]() |
After more reflection, I will try and come up with a better color picker. Looking into the subject of color range a little more, each picker works better in certain situations. The HSB color picker works the best overall, but... it is not able to deal with non-saturated colors or near non-saturated color. An RGB value of 129,128,128 would be considered Red, but in reality should not show up in most color picks with any saturation. I noticed in some images (usually blown out) that values of 255,255,255 (or colors like it, say 128,128,128) are assigned the Red hue, but by definition have an undefined Hue. I had to put a bit of code in the HSB color picker to deal with this. The Euclidean RGB color picker is technically more accurate, but does not take into account the way people "see" colors, that is, Hue is more important in matching than Saturation and Brightness.
Math meets art meets psychedelia. |
|
Posted: August 30, 2015 8:25 pm | ||
Kraellin
![]() |
a color range filter was asked for several years ago by me. a couple folks worked on it, including me, but nothing satisfactory was ever done. you might do a search on this in the forums to find that old thread. maybe there's some ideas that could be used with all the new stuff in FF now.
If wishes were horses... there'd be a whole lot of horse crap to clean up!
Craig |
|
Posted: September 8, 2015 11:19 pm | ||
Rachel Duim
![]() |
I have found a better method. It took a little thought, but I have a working color picker and will release it after some more testing. It's a Weighted Euclidean Lab Color Picker. Lab color gets around the issues with Hue in color picking (mainly that it is undefined when Saturation is zero). I want to release it as a snippet but here it is, I would like some comments before I put it out.
Trust the presets, they have values that seem to work the best when it comes to Threshold values etc. Weighted Euclidean LAB color picker 2.ffxml Math meets art meets psychedelia. |
|
Posted: September 8, 2015 11:39 pm | ||
Kraellin
![]() |
yeah, that's pretty good, but needs more refinement. using the bird picture and picking a green hue as the color picker value, when I adjust the sliders for emphasis and threshold as I pick up and then lose the blue hues, some of the green disappears before all of the blue. not sure of all the hex values here and how this all gets checked internally, but it's still a little off. but, like I said, this is about the best I've seen in all the attempts from years ago and now and is still very helpful. this could easily be incorporated into other filters for color picking ranges.
If wishes were horses... there'd be a whole lot of horse crap to clean up!
Craig |
|
Posted: September 9, 2015 10:11 pm | ||
Kraellin
![]() |
ok, I'm going to eat my words a bit here. this is actually pretty damn good. I've opened up the filter and like the simplicity here. I'm testing out a few variations on how you use the multiply and other components after the subtract, but now that I'm getting more familiar with the controls, I take back what I said just above
![]() If wishes were horses... there'd be a whole lot of horse crap to clean up!
Craig |
|
Posted: September 9, 2015 10:18 pm | ||
Kraellin
![]() |
ok, after more testing, I find that there's a bit of a trouble here. if you take an orange and reddish range but the image also has some greens, and even though your range is in the oranges, some of the reds and oranges and browns will disappear before some of the greens and this seems a bit off.
If wishes were horses... there'd be a whole lot of horse crap to clean up!
Craig |
|
Posted: September 9, 2015 10:48 pm | ||
Rachel Duim
![]() |
I probably should have pointed out what ranges of values work the best. Color Threshold especially needs to be between 50-80 (70 as default). And Color Emphasis above 60, 80 is the default. Feathering 5 as default, no higher than 15. I will limit the range of values when I submit this, still a bit more testing after tweaking the controls.
BTW, the formula you are seeing is a 3D Euclidean distance formula. L, a, and b are the three dimensions. It's "weighted" to favor the color/saturation channels, a, b. Color Emphasis controls the weighting. Math meets art meets psychedelia. |
|
Posted: September 9, 2015 10:48 pm | ||
Rachel Duim
![]() |
This color range picker is more sensitive to saturation. Play around in the Match Color with raising and lowering the saturation only and to see if this helps. If not, give me some specific RGB values for match colors and images to look at and I'll give it more thought.
Math meets art meets psychedelia. |
|
Posted: September 9, 2015 10:52 pm | ||
Kraellin
![]() |
here's one of the images I was playing with as far as the reds and greens. if you wanted to get the range of colors pulling in most of her facial colors and her hair colors, it's very hard not to also get a lot of the greens around the outside of her hair. this is one of the problems we had a few years ago with doing color range. do a 50/5/80 on your sliders and you'll see what I mean. I don't get why the greens cant be separated out better and still get most of the reddish hues.
also, as a thought, what if you put in another algorithm, along with the one you have, that put in a second color value as a final subtraction on the first. wouldn't it be possible to 'subtract' those greens in the provided image by doing this? ![]() If wishes were horses... there'd be a whole lot of horse crap to clean up!
Craig |
|
Posted: September 10, 2015 8:48 am | ||
Kraellin
![]() |
take the above image and start at 50/5/100 and you'll see the greens. these settings also get a large amount of her hair and face. as you move the 50 up, you will start to eliminate the greens but you also start to lose some of the reds and that's what I'd like to fix.
If wishes were horses... there'd be a whole lot of horse crap to clean up!
Craig |
|
Posted: September 10, 2015 8:52 am | ||
Kraellin
![]() |
oh, sorry, the color match value I'm using is 146/82/0 on the rgb, but you can set it at other values around there and you can still see what I mean.
If wishes were horses... there'd be a whole lot of horse crap to clean up!
Craig |
|
Posted: September 10, 2015 8:53 am | ||
Rachel Duim
![]() |
Good news, bad news. The picker is working properly. Yes, the edge of the hair definitely shows the tendency towards green. One problem is the 50 value on color threshold, normally I would consider this too large a color range. Problem is skin and hair are usually very difficult to match, the range of colors is much greater than we perceive. So, I am testing with Photoshop's magic wand at different tolerances (UPDATE: make sure to uncheck Contiguous). Start at tolerance 40 and use the wand. Then move it up to 60 to test the wand. You will see green results creeping in when wanding the hair. Seems in comparing the Magic Wand with the FF color range picker, the FF picker does pretty well.
The question is this, is it worth having a 2 color picker? One color you want, the second a reject color? Also, I have considered a 2 color picker that picks the range of colors between the two, but it is a lot more work (mathematically). Math meets art meets psychedelia. |
|
Posted: September 10, 2015 11:49 am | ||
Kraellin
![]() |
Comparing to magic wand is a good idea. Dant thought of that.
As for a two color picker, if you could use one to set the major range and use the other to trim it, it would be very unique and very useful. As for how much work and worth it to you, that's completely up to your evaluation but I'd love it! I've always found the magic wand selectors lacking in Photoshop and paint shop pro. If wishes were horses... there'd be a whole lot of horse crap to clean up!
Craig |
|
Posted: September 11, 2015 8:19 pm | ||
Rachel Duim
![]() |
To tell you the truth, the real problem is not the magic wands in editing tools, it is the human perception of color. Humans "perceive" color (hue) more than brightness and saturation in a scene or photograph. Also we take in account areas, so it is somewhat like the Magic Wand with Contiguous checked in Photoshop. I have not found a great simple color range picker, especially for photographs. It's mostly due to the color models not being able to match human perception of color in a "linear" way + the wide dynamic range of many photographs. So the math used to match human perception of color is only an approximation, IMHO.
I'll put the color range picker out on Monday. Thanks for your input Craig ![]() Math meets art meets psychedelia. |
|
Posted: September 11, 2015 10:08 pm | ||
Rachel Duim
![]() |
UPDATE: Never one to stop tinkering, I found another improvement. The main idea is to reduce the input image to less samples (to make the pick more of an "area" pick). Did it with Median, as another slider. This is a rough equivalent of a 3x3 or 5x5 sample area you can pick with the Magic Wand in Photoshop as an option.
The Median component helps to improve the color range of the "hair" example above, but still nowhere near ideal due to the limitations discussed above. I'll still try to get this out Monday with the new improvement tested blah blah blah. Math meets art meets psychedelia. |
|
Posted: September 11, 2015 11:29 pm | ||
Kraellin
![]() |
cool beans. in the meantime, you can always post a copy here so I can start playing with it
![]() If wishes were horses... there'd be a whole lot of horse crap to clean up!
Craig |
|
Posted: September 11, 2015 11:49 pm | ||
Rachel Duim
![]() |
||
Posted: September 12, 2015 12:32 am | ||
Kraellin
![]() |
got your new color picker. thanks
![]() have been revisiting some of the older color range and mask filters and here's what I got using one of those. this one was originally one by me. I altered it, however. I don't recall who the original person was now and there's no record on the filter of the original author. this one came out pretty good. they don't always. the controls on the filter aren't marked very well and I'm out of practice with the filter. still, this came out fairly well. I'm wondering, after playing with all these filters, if it wouldn't be easier to make a color range filter based on the HLS component. one could limit the range of each of these qualities and perhaps get something quite refined. ![]() If wishes were horses... there'd be a whole lot of horse crap to clean up!
Craig |
|
Posted: September 13, 2015 1:26 am | ||
Kraellin
![]() |
whoops, that didn't come out right!
If wishes were horses... there'd be a whole lot of horse crap to clean up!
Craig |
|
Posted: September 13, 2015 1:27 am | ||
Kraellin
![]() |
||
Posted: September 13, 2015 1:36 am | ||
Rachel Duim
![]() |
Try using your modified range picker to try and pick out greys, blacks, and whites (from the built-in images). If it works, let me know. Hue based pickers have trouble with non-saturated images, I think?
Math meets art meets psychedelia. |
|
Posted: September 13, 2015 2:21 pm | ||
Rachel Duim
![]() |
I am putting the Lab color range picker on the shelf. Maybe someday I will find a use for it. Maybe your picker is the solution?!
Math meets art meets psychedelia. |
|
Posted: September 15, 2015 8:01 pm | ||
SpaceRay
![]() |
The color range picker would be very useful to remove an unwanted background that has a fixed amount of color range, but should be taken maybe not from all the source image, but from contigous and close pixels whitin the same color range, so his way would not delete color with same color range that are wanted to be included
|
|
Posted: September 16, 2015 6:16 am | ||
Kraellin
![]() |
frankly, rick, yours is MUCH better. I just got lucky. after looking at the guts of the thing again, I'm surprised I even got it that good.
If wishes were horses... there'd be a whole lot of horse crap to clean up!
Craig |
|
Posted: September 17, 2015 11:16 pm | ||
Rachel Duim
![]() |
Thanks. I'm not sure what I am going to do with it. I feel that the user expectations may be too high for what I've done. It works in a similar fashion to the Photoshop magic wand with contiguous unchecked. But as has been noted, it doesn't handle some photographs that well, but it's a deficiency of most wand tools. You can try to adjust the tolerance of the FF tool or the magic wand in Photoshop, but the result set just gets too large.
So you see my misgivings. Any votes for releasing Color Range Picker with Median as a snippet? Math meets art meets psychedelia. |
|
Posted: September 17, 2015 11:48 pm | ||
SpaceRay
![]() |
i vote that you release it and make it available wih a note telling this that you have written here, so the possible user will know what to expext fr om it.
As it happens with many other filters, it will not work right with ANY image, and you would to select images carefully, but I think it could very useful and interesting in some situations also I suggest to have an option to choose contigous color OR similar color range, as it could be possible that if you want to remove a whole gradient background, it whole be needed to be select all of it, and not only the contigous parts, so one checkbox to choose either contigous or similar. also if possible it would be good and useful to be able to pick wh ere it will start to count the contigous selection of color range And I wonder if it could be possible to select two different color ranges in the same image, as a gradient may be composed of two colors. what happens with the edges of the color range? Are they sharp and pixelated? Or maybe a little soft, lime it happen with the antialiasing effect? Thanks Rick GOOGLE SEARCH IMAGES there are possible examples for selected images gradient background isolated flower black background isolated flowers |
|
Posted: September 18, 2015 1:16 am | ||
Rachel Duim
![]() |
I will say that you are enthusiastic Ray
![]() 1) I will release it. I may or may not put a disclaimer. The user notes are already maxed out. If someone complains about the performance, I will reply via the forums. 2) Contiguous color? Not simple to implement, actually I have no idea how I would do it. Map script? Using the new Pixel tools in 5? I would do the UI with crosshairs... but this is for someone else to figure out. 3) Picking a color range between 2 different colors is a different (& more complex including dot product) mathematical formula (the distance between a point and line segment in 3d space). Point-Line Distance in 3d. Since it is not an infinite line, it's a special case of the formula involving additional Euclidean distance calculations. Probably for someone else to figure out. 4) The edge of the range color can be sharp or fuzzy based on the Feathering control in the filter. Any who... I will submit it tonight and hope it is not met with critical derision. Math meets art meets psychedelia. |
|
Posted: September 18, 2015 2:23 pm | ||
SpaceRay
![]() |
Thanks very much for the detailed answer and comments
Good that you will make it available I have to say that when i am suggesting possible things, i have no idea how difficult is to be done, and if there may be technical limitations, or if it may need coding to do it, or if it involves additional things that may be complex to do What i put are just ideas, and you can take the ones you like, can do and want to do Of course this is all your own decidions and is up to you to do it as you want as these are only possible suggestions, not requests |
|
Posted: September 19, 2015 12:57 am | ||
Rachel Duim
![]() |
No problem. I realize what you said, I like to think these things through, sometimes possibilities emerge from these ideas. Since there is not a mechanism for "clicking" within an image as an "external" input that returns pixel position, FF is not the right tool for "magic wanding" with contiguous. I can simulate with crosshairs and two value controls and a checkbox... not the same. Then to do the contiguous in code is probably an array checking sort of thing, so Lua is needed. Not enough bang for the buck.
This snippet will be useful for selective color editing (shifting/rotating HSB etc etc). Math meets art meets psychedelia. |
|
Posted: September 19, 2015 1:40 pm | ||
xirja
![]() |
Seems like a good solution.
![]() ![]() _____________________________________________________
http://web.archive.org/web/2021062908...rjadesign/ _____________________________________________________ |
|
Posted: September 21, 2015 8:27 am |
Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!
33,712 Registered Users
+19 new in 30 days!
153,537 Posts
+6 new in 7 days!
15,348 Topics
+72 new in year!
28 unregistered users.