Read in a gradient from a png file and spit out CSS for it
See the codepngtocss takes in a png file with a gradient in it and spits out the necessary CSS to draw that gradient.
See the examples/ directory for all the pngs that I've tested this with. Feel free to submit your own (keep them small).
See the src/ directory for the source code.
It's written in C, and uses libpng 1.6.25 and zlib 1.2.8. You'll need both of those to compile it. Also, I wrote it on MacOSX, so I installed the libraries using ports. You may need to play with the Makefile if you're using a different OS. Sorry, I don't have the time to test, but if you submit a pull request, I'll merge it.
BSD Licensed v2.0
© Philip Tellis -- philip@bluesmoon.info -- http://bluesmoon.info/
Everything I know about reading a PNG I got from Chapter 13 of the libpng book: http://www.libpng.org/pub/png/book/chapter13.html
The CSS gradient syntax came from these wonderful sites:
Nicole tweeted about the absence of a tool to convert images to gradients:

I realised that I knew neither what CSS gradients were, nor how to read a PNG file, so figured that this was a good opportunity to learn both at once. I decided to write it in C because I hadn't written C code in a very long time.
Patches welcome.
Talk about pngtocss on the discussion page
C
98.3%
Makefile
1.7%
Read in a gradient from a png file and spit out CSS for it
See the codepngtocss takes in a png file with a gradient in it and spits out the necessary CSS to draw that gradient.
See the examples/ directory for all the pngs that I've tested this with. Feel free to submit your own (keep them small).
See the src/ directory for the source code.
It's written in C, and uses libpng 1.6.25 and zlib 1.2.8. You'll need both of those to compile it. Also, I wrote it on MacOSX, so I installed the libraries using ports. You may need to play with the Makefile if you're using a different OS. Sorry, I don't have the time to test, but if you submit a pull request, I'll merge it.
BSD Licensed v2.0
© Philip Tellis -- philip@bluesmoon.info -- http://bluesmoon.info/
Everything I know about reading a PNG I got from Chapter 13 of the libpng book: http://www.libpng.org/pub/png/book/chapter13.html
The CSS gradient syntax came from these wonderful sites:
Nicole tweeted about the absence of a tool to convert images to gradients:

I realised that I knew neither what CSS gradients were, nor how to read a PNG file, so figured that this was a good opportunity to learn both at once. I decided to write it in C because I hadn't written C code in a very long time.
Patches welcome.
Talk about pngtocss on the discussion page
C
98.3%
Makefile
1.7%