Book Image

Mastering Julia

Book Image

Mastering Julia

Overview of this book

Table of Contents (17 chapters)
Mastering Julia
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Raster graphics


Most of the types of displays we have been considering so far are termed vector graphics. These are defined in terms of points, curves, and shapes such as circles, rectangles, and polygons.

Working with images and colormaps is often referred to as raster graphics.

Since low-level packages eventually translate vector plots to rasters, these packages are capable of working with images directly.

So far in this book we have been working with simple netbpm format images, but in practice we will wish to operate with the more common formats such as PNG, GIF, and JPEGs.

So in this final section, we'll turn our attention to a brief overview of some of the ways you can manipulate images in Julia.

Cairo (revisited)

The Cairo package is a low-level package that we met earlier in the Basic graphics in Julia section and used it to create a curve between four points.

In the following example, we will create the graphics context from an RGBSurface method as before and fill the background with a...