identify -verbose gives colors in #xxxxxxxx form
Posted: 2009-06-04T11:12:00-07:00
Until recently, I have been extracting the RGB colors from gif files using indentify -verbose. The results always gave me an array of colors in the expected form, #xxxxxx, which I then used in CSS, for setting color styles.
In PHP, the function I have been using to extract the colors is as follows:
preg_match('/([0-9]+):.*(#[0-9ABCDEFabcdef]+)[ ]*/', $hist, $color);
Previously, the $color variable always came through as a 6 digit RGB color.
Now I see that the colors are coming through with 8 digits instead of 6, #xxxxxxxx. Will someone please fill me in on what is happening and how to translate this new color scheme into a scheme that works with CSS?
Additionally, is there a more appropriate way to extract RGB colors from an image file rather than identify -verbose?
In PHP, the function I have been using to extract the colors is as follows:
preg_match('/([0-9]+):.*(#[0-9ABCDEFabcdef]+)[ ]*/', $hist, $color);
Previously, the $color variable always came through as a 6 digit RGB color.
Now I see that the colors are coming through with 8 digits instead of 6, #xxxxxxxx. Will someone please fill me in on what is happening and how to translate this new color scheme into a scheme that works with CSS?
Additionally, is there a more appropriate way to extract RGB colors from an image file rather than identify -verbose?