hughesadam87 / pyparty

Drawing and analyzing particles on images
Other
35 stars 17 forks source link

Better naming conventions for colors #39

Open hughesadam87 opened 10 years ago

hughesadam87 commented 10 years ago

So I have the following:

to_normrgb (Takes colors, but not arrays) rgb2uint (takes arrays) any2rgb (takes arrays)

For completeness, need a to_normgray or something. The only time I've needed this so far is in noise._parse intensity()

if img.ndim == 2:
    r,g,b = intensity
    intensity = 0.2125 * r + 0.7154 * g + 0.0721 * b

If possible, shouldn't only 2 of these be required:

any2rgb any2uint

hughesadam87 commented 10 years ago

Made any2uint, no super well-tested, but used in mc.from_labels( mapper = ...)

Also any2rgb should handle non-arrays just by wrapping to_normrgb() any2bool also needs there