quadule / colorscore

Finds the dominant colors in an image and scores them against a user-defined palette, using the CIE2000 Delta E formula.
87 stars 26 forks source link

fixed doesn't parse RGB from srgba #7

Open myriky opened 7 years ago

myriky commented 7 years ago

i've figured out why doesn't parse png files. cuz wrong REGEX.

$ convert '가나다라마법사.jpg' -resize 400x400 -format %c -dither None -quantize YIQ -colors 1 -depth 8 histogram:info:-
    135200: (141,146,140) #8D928C srgb(141,146,140)

===> it's ok. RGB decimals length is 6

but, png file

$ convert '간장공장공장장.png' -resize 400x400 -format %c -dither None -quantize YIQ -colors 1 -depth 8 histogram:info:-
    119600: (117,118,121,255) #757679FF srgba(117,118,121,1)

===> um.. RGB decimals length has 8 include alpha value.

i had fix wrong REGEX. please check it out. thank you :)