Home > Computer Graphics, Languages, Mathematica, Software > Pixel-perfect Graphics, Revisited

Pixel-perfect Graphics, Revisited

November 25th, 2008

Mathematica 7 introduces a new Image function that eliminates all the hassle previously necessary to create and export pixel-perfect raster images.

Instead of using ArrayPlot to generate the image, I can now do this:

myImage = Image[imageData, ColorSpace->RGBColor]


I still need to specify RGBColor to interpret the alpha channel correctly, but the option to Image is named ColorSpace, instead of the ColorFunction used by ArrayPlot.

Exporting works the same way as before:

Export["~/Desktop/myImage.png", myImage]

Except that now I can directly export a png with alpha. Much simpler overall in the new Mathematica.

Computer Graphics, Languages, Mathematica, Software

Comments are closed.