Jump to my Home Page Send me a message Check out stuff on GitHub Check out my photography on Instagram Check out my profile on LinkedIn Check me out on Facebook

MRaster -- Mitch's Raster Graphics Library

Table Of Contents

What is it?

MRaster is a small library I use to render off-screen, raster graphics (images). The library started as a simple, macro library adapting various screen graphics APIs (X11, MacOS, Windows, MS-DOS, etc...) to a uniform API supporting the simple needs of a budding mathematician. As I began to use more remote computational resources at HPC centers in the 90's, the library transformed into an off-screen rendering library and image processing library for high depth, scientific images. As better image processing libraries began to appear, the library once again shifted back to it's original core -- rendering mathematical objects (from directly rendering 2D things like the Mandelbrot set to being the raster back end for a multidimensional ray-tracing tool for topological manifolds).

Features

The feature set for MRaster is quite focused on raster (pixel) graphics. The kinds of things that go on in the background of higher level (vector, 3D, etc..) libraries.

  • Super simple, easy to use, and adaptive to various situations.
  • Reasonably fast for a single-threaded, CPU bound graphics library.
  • Portable, standard C++ with no external library requirements -- that's right. NONE!
  • No upper limits on the number of channels per image, but two channels are not supported.
  • No upper bound on the depth of each channel, but channel depths lower than 1 byte are not space efficient.
  • Image sizes are limited by available RAM and the sizes of native integer C++ types.
  • Various color theory computations and color space conversions are supported -- HSL, HSV, etc...
  • Very good support for gradient based color scales frequently used for scientific visualization.
  • A small selection of high quality, discrete color scales are provided.
  • Simple primitive scan-line conversion -- points, lines, triangles, rectangles, circles.
  • Flexible image space coordinates (both integer and floating point)

Ease of use is one of the most important aspects of this library. Here is an example of how to create a nice Mandelbrot set image in just a few lines of C++ code:

Non-features

What don't we do with MRaster? Frankly, the non-features are features -- i.e. we don't do things that we are not good at or things for which other libraries are better.

  • Anti-aliased primitive rendering.
  • Sophisticated font rendering.
  • Very little support for non-homogeneous image processing transforms.
  • No 3D.

Most of the non-features are best supported by better libraries.

  • Cairo -- My favorite vector graphics library.
  • ImageJ -- One of my favorite image analysis & processing platforms.
  • ImageMagick -- A veritable Swiss army knife for batch image processing.
  • VTK -- Comprehensive 3D data visualization library.

Gallery


Color Reduction (Web Safe & Color Blind)


Color Scales

Fractals!

Legal Stuff

All materials available from this website is copyright protected © 1990-2015 by Mitch Richling.

This software, MRaster, is licensed under a BSD-like license. You can find it in the LICENSE.TXT file in the distribution. The content of that file is as follows:

/* -*- Mode:text; Coding:us-ascii-unix; fill-column:132 -*- */
The license for this software is as follows:

=======================================================================
Copyright (c) 1994-2015, Mitchell Jay Richling 
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

1. Redistributions of source code must retain the above copyright
   notice, this list of conditions, and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions, and the following disclaimer in
   the documentation and/or other materials provided with the
   distribution.

3. Neither the name of the copyright holder nor the names of its
   contributors may be used to endorse or promote products derived
   from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=======================================================================

        

Let me say it again... Under no circumstances and under no legal theory, whether in tort, contract, or otherwise, shall Mitch Richling be liable to you or to any other person for any indirect, special, incidental, or consequential damages of any character including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or for any and all other damages or losses.

If you do not agree with these terms, then you must not use the software.

Source Code

Get it on github! You can find the github ZIP file here: master.zip.

© 2009 Mitch Richling