O'Reilly logo

Mastering openFrameworks: Creative Coding Demystified by Denis Perevalov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating and modifying images

In the preceding sections, we considered different ways of drawing images loaded from files. In this section, we see how to generate new images or alter an existing image by specifying its pixels directly.

A raster image is represented as an array of pixels in memory. If we have an image with width w pixels and height h pixels, it is represented by N = w * h pixels. Normally, the horizontal rows of an image lie sequentially in memory: the w pixels of the first row, then the second row, and so on to the h row.

The pixels of the image can hold differing amounts of information depending on the image type. In openFrameworks, the following types are used:

  • The OF_IMAGE_COLOR_ALPHA type denotes a colored image with transparency. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required