Manipulating images in parallel using Repa

Repa is a powerful library for manipulating high-dimensional arrays in parallel. We will use it to read and edit the pixels of an image.

Getting ready

Install Developer's Image Library (DevIL), a cross-platform image manipulation toolkit. It can be downloaded from http://openil.sourceforge.net/download.php or through apt-get on Debian systems as follows:

$ sudo apt-get install libdevil-dev

Install the Repa package from cabal for the DevIL toolkit as follows:

$ cabal install repa-devil

Create two images named image1.png and image2.png that have the same dimensions, which are shown as follows:

Getting ready

Here comes the ...

Get Haskell Data Analysis Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.