Image editing using ArrayFire

Pradeep ArrayFire, Image Processing 2 Comments

In this post, we will be looking at the following simple image editing operations using the ArrayFire library.

  • contrast modification
  • brightness modification
  • translation
  • digital zoom
  • alpha blending
  • unsharp mask

Code required to do each operation and the corresponding input/output sample are given below in their corresponding sections. All the operations are built using some existing image manipulation functions and the awesome element-wise operations in ArrayFire.

Contrast modification

Brightness modification

You may add an additional step to the above function that clamps each pixel value to [0,255] range. Clamping can be easily achieved by the following line of code.

or a more generalized clamp/thresholding operation would like as below.

Image translation

This operation can be achieved directly by a function in our library translate. A sample output of the function translate(a,100,100,200,126) on the sample input is provided below.

Digital Zoom

Alpha Blending

For the purpose of this example, a very simple mask was created using the following code stub.

A more detailed and accurate mask would deliver more appropriate blending.

Unsharpmask

Conclusion

We are working on a free image editing application based on ArrayFire. This is the first part of the series that discusses our progress. You can follow the project here.

Facebooktwittergoogle_plusredditlinkedinmail