Are these like a line, rectangle, or circle of pixels in a photographic or drawn image? Should your "average" be weighted towards the center of the selection area, or all all pixels of equal interest? Can you say more about what a chunk is - 20 pixels, 200?
How are you planning to average two or more colors?
lerpColor() gives linear interpolation between two colors -- so, for example, you could find the outliers and then linearly interpolation them.
Note however that outlier components and outliers are a different thing -- and that linear interpellation of color RGB components do not always give visually intuitive values for hue, brightness etc.
Answers
The
color
type is secretly anint
. Try:oh ok
So, i'm trying to get an average of chunks of color. How do I get the real color?
What you are getting with
get()
is acolor
. The problem is thatprinln()
doesn't treat the color you got like acolor
- it thinks it is anint
!How are you planning to average two or more colors?
Common questions:
https://forum.processing.org/two/discussion/8086/what-is-a-color-in-processing
Are these like a line, rectangle, or circle of pixels in a photographic or drawn image? Should your "average" be weighted towards the center of the selection area, or all all pixels of equal interest? Can you say more about what a chunk is - 20 pixels, 200?
lerpColor()
gives linear interpolation between two colors -- so, for example, you could find the outliers and then linearly interpolation them.Note however that outlier components and outliers are a different thing -- and that linear interpellation of color RGB components do not always give visually intuitive values for hue, brightness etc.
Eh, I fixed it. The problem was with the averaging of the LITERAL color values. I just stored the separate RGB values.