in reply to Re: A data selection problem(in3D).
in thread A data selection problem(in3D).
First, this code creates a hash containing an entry for each unique color in an image. Then the colors are sorted by Luma value and broken into 17 groups of colors with similar Luma. Then, an average RGB triple is calculated for each group, weighted by the pixel count of each color in the input image. This produces a coarse gradient of 17 colors with ascending luma. A linear interpolation is then performed between these reference colors to get a gradient of 256 colors.
First: thank you for your response and code.
However, there are problems with that approach.
The source picture is used to discover the range of tones and tints reflecting from the chosen material/surface, not their proportions.
Once you apply the gradient to models, the proportions of light and shade are (need to be) dictated by the shape and lighting angles of the target model, not the source image.
The problem is that produces too wide a band of dark (near black) and light (near white) shades; and thus throws away too much of the primary shades that will dominate most(*) models.
That could be addressed by making 15 groups and then end-stopping with the darkest and lightest colors found; but that will tend to emphasis the final issue.
This might be addressed by interpolating the between-chosen-points values and then going back to the dataset to find the 'nearest' value that exists there; but in my attempts, defining 'nearest' in a 3D space is fraught with problems, and inevitably results in uneven jumps in the gradient that stand out like sore thumbs when applied to a model.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: A data selection problem(in3D).
by coicles (Sexton) on Apr 08, 2017 at 02:31 UTC | |
by BrowserUk (Patriarch) on Apr 08, 2017 at 02:55 UTC | |
|
Re^3: A data selection problem(in3D).
by coicles (Sexton) on Apr 08, 2017 at 02:42 UTC |