Hi,
This is another half a feature request, half a patch, like the one I just filed about sampled shadings. Sampled shading didn't work out so good, and in places I needed a grid of 'pixels', but lots of little rectangles really slowed down my pipeline, and made big files... So I coded up some stuff to use inline image data rather than a file. I also added inline masks, since that was simple, and added the ability to use masks as fadings.
This would be very useful to any plotting package using PGF, since one can use this to things like matlab's pcolor, R's levelplot or gnuplot's map. It is also useful for anyone who is outputting images from code. It would be good to add some colorspace arguments, so one can set how many color components and the bits per channel. This feature shouldn't be too difficult to achieve in postscript, and one could even do it in SVG if one was willing to output PGM or PPM or some other non-encoded format in a data url.
I think there is a bug in usefading, which has a 'pgfsmaks' instead of 'pgfsmask'. I should probably file a separate bug for that...
Thanks for a great graphics package.
-Jeremy
Test file for raw images