- Main Page
- Tutorials
- Functions
- Release Notes
- Examples

Functions
loadImage
Complete List of ArrayFire Functions ArrayFire Functions by Category » Input and Output functions » | Reading and writing images

Load an image from disk to an array. More...

## Functions
AFAPI array | loadimage (const char *filename, const bool is_color=false)
| C++ Interface for loading an image. More...
AFAPI array | loadImage (const char *filename, const bool is_color=false)
| C++ Interface for loading an image. More...
AFAPI af_err | af_load_image (af_array *out, const char *filename, const bool isColor)
| C Interface for loading an image. More...

## Detailed Description

Load an image from disk to an array.

Supported formats include JPG, PNG, PPM and other formats supported by freeimage

## Function Documentation

AFAPI af_err af_load_image | ( | af_array * | out,
|  | const char * | filename,
|  | const bool | isColor
| ) |  |

C Interface for loading an image.

Parameters

  [out] | out | will contain the image
  [in] | filename | is name of file to be loaded
  [in] | isColor | boolean denoting if the image should be loaded as 1 channel or 3 channel

Returns
  AF_SUCCESS if the color transformation is successful, otherwise an appropriate error code is returned.

Examples:
  fast.cpp, and harris.cpp.

AFAPI array af::loadImage | ( | const char * | filename,
|  | const bool | is_color = `false`
| ) |  |

C++ Interface for loading an image.

Parameters

  [in] | filename | is name of file to be loaded
  [in] | is_color | boolean denoting if the image should be loaded as 1 channel or 3 channel

Returns
  image loaded as af::array()

Examples:
  adaptive_thresholding.cpp, binary_thresholding.cpp, brain_segmentation.cpp, edge.cpp, fast.cpp, filters.cpp, harris.cpp, image_demo.cpp, image_editing.cpp, kmeans.cpp, matching.cpp, morphing.cpp, optical_flow.cpp, pyramids.cpp, and susan.cpp.

AFAPI array af::loadimage | ( | const char * | filename,
|  | const bool | is_color = `false`
| ) |  |

C++ Interface for loading an image.

Parameters

  [in] | filename | is name of file to be loaded
  [in] | is_color | boolean denoting if the image should be loaded as 1 channel or 3 channel

Returns
  image loaded as af::array()

Deprecated:
  Use loadImage instead