hehe... you could try just doing wholesale changes on a button tweaking the algorithm each time until it looked like you want :) You could also maybe do a nearest neighbor for one or two pixels in every direction, to see if you are near a pure blue.
But the easiest would probably be to go in, sample some of the anti-aliased colors, and try to work out a rule set based on their values. No matter what, it's gonna suck :) On Wed, Jun 18, 2003 at 09:35:11PM -0400, John Sequeira wrote: > Anthony R. J. Ball wrote: > > <snip> > > > As for changing image colors, you could do that with imlib2 > >as well... though maybe pixel by pixel. The probalem you may run > >into is if they have anti-aliased text, which will make wholesale > >color-swapping difficult. > > > Thanks everyone for your suggestions. > > Using one of the libraries recommended, I believe I can walk the > directory, load each gif image and then loop through each pixel, > changing all solid colors from e.g. blue (0,0,255) to green (0,255,00) . > > But, as Anthony pointed out, I will have the problem of the text being > antialiased. > > So if I have a blue button with yellow text, I know how to transform > the blue and yellow to what I want, but I'll also have a gradient of > pixels surrounding them with colors in between blue and yellow. > > Is there a way to figure out what the yellowish or blueish antialiasing > pixels should map to in the new graphic? > > Would I have to dig down deep into understanding antialiasing > algorithms, or is there a simpler way to use something like a color > wheel/whatever it's RGB analog would be? > > > John Sequeira > http://radio.weblogs.com/0103492/ > > > > _______________________________________________ > Boston-pm mailing list > [EMAIL PROTECTED] > http://mail.pm.org/mailman/listinfo/boston-pm -- ___ __ __ __ _ _ ____ _ _ ____ ____ / __)( )( ) /__\( \/ )( ___) ( \( )( ___)(_ _) \__ \ )(__)( /(__)\\ / )__) ) ( )__) )( (___/(______)(__)(__)\/ (____)()(_)\_)(____) (__) Just think, in a few million years Barney will be motor oil. _______________________________________________ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm