From: Phlip Date: 2009-03-23T07:07:02+09:00 Subject: Re: convert PNG to hex jeljer te Wies wrote: > I have a question ... I have to convert a png to hex (#FFFFFF). > I searched now for over 2 hours but can't find anything that works (like > png library or RMagick). Are you asking how to convert the PNG file to one of its colors? Use ImageMagick (or GraphicsMagick, via the command line, or MiniMagick, or RMagick) to convert the PNG file to the most dirt-simple raster format possible, such as YUV. Then read the first few bytes in each bit-plane, in that format's encoding, and hash them together. There are also get-pixel commands in RMagick...