# `Image.QRcode`
[🔗](https://github.com/elixir-image/image/blob/v0.66.0/lib/image/qrcode.ex#L2)

Detects and decodes QRcodes.

Note that the implementation, which is based upon
[eVision](https://github.com/cocoa-xu/evision) requires that
the image be a 3-channel image in order to support
detection.

Images that are in different formats must be converted
first.

### Note

This module is only available if the optional dependency
[eVision](https://hex.pm/packages/evision) is configured in
`mix.exs`.

# `decode`
*since 0.9.0* 

Detects and decodes a QR code in an image.

### Arguments

* `image` is any `t:Vix.Vips.Image.t/0` that
  has three bands (for example, a typical srgb
  image).

### Returns

* `{:ok, string}` or

* `{:error, reason}`

### Note

Only images with three bands (channels) are
supported. This restriction may be lifted in
a future release.

# `encode`
*since 0.13.0* 

Encodes a string as a QRCode.

### Arguments

* `string` is any string to be encoded,

* `options` is a keyword list of options. The
  default is `size: :auto`.

## Options

* `:size` is the size in pixels of the QRcode
  dimensions. The default is `:auto` in which
  the generated QRcode will be the minimum dimensions
  necessary to encode the `string`.

### Returns

* `{:ok, image}` or

* `{:error, reason}`

### Examples

    iex> {:ok, image} = Image.QRcode.encode("hello world")
    iex> Image.bands(image)
    3

    iex> {:ok, image} = Image.QRcode.encode("This is a string")
    iex> {:ok, "This is a string"} = Image.QRcode.decode(image)
    iex> :ok
    :ok

---

*Consult [api-reference.md](api-reference.md) for complete listing*
