How to Read QR Code from Images

Reading a QR code refers to the process of scanning and decoding the information stored within a QR code. This is typically done using a camera or scanner paired with software that can interpret the QR code's data. The information in a QR code could be text, URLs, contact details, or other forms of data.

Start using IronQR in your project today with a free trial.

First Step:
green arrow pointer

Read QR Codes from Images

One of IronQR's standout features is its built-in capability to read QR codes from various image formats seamlessly. This includes:

* Joint Photographic Experts Group (JPEG)
* Portable Network Graphics (PNG)
* Graphics Interchange Format (GIF)
* Tagged Image File Format (TIFF)
* Bitmap Image File (BMP)
* WBMP
* WebP
* Icon (ico)
* WMF
* RawFormat (raw)

This functionality is enabled by the open-source library, IronDrawing. Let's now explore how IronQR can be used to read QR code from the image below.

QR code
:path=/static-assets/qr/content-code-examples/how-to/read-qr-code-image.cs
using IronQr;
using IronSoftware.Drawing;
using System.Collections.Generic;
using System;

// Open the asset to read a QR Code from
var inputBmp = AnyBitmap.FromFile("IMAGE_TO_READ.png");

// Load the asset into QrImageInput
QrImageInput imageInput = new QrImageInput(inputBmp);

// Create a QR Reader object
QrReader reader = new QrReader();

// Read the Input an get all embedded QR Codes
IEnumerable<QrResult> results = reader.Read(imageInput);

foreach(var result in results)
{
    Console.WriteLine(result.Value);
}
Imports IronQr
Imports IronSoftware.Drawing
Imports System.Collections.Generic
Imports System

' Open the asset to read a QR Code from
Private inputBmp = AnyBitmap.FromFile("IMAGE_TO_READ.png")

' Load the asset into QrImageInput
Private imageInput As New QrImageInput(inputBmp)

' Create a QR Reader object
Private reader As New QrReader()

' Read the Input an get all embedded QR Codes
Private results As IEnumerable(Of QrResult) = reader.Read(imageInput)

For Each result In results
	Console.WriteLine(result.Value)
Next result
VB   C#

Curious about the QR code value in the sample images? Give it a try using the code snippet!


Supported QR Code Types

Multiple types of QR codes are supported for both creation and reading. Below are the supported QR code types:

  • QRCode: This is the standard QR code most commonly used today. It can store a significant amount of data (up to 7,089 numeric characters or 4,296 alphanumeric characters), making it suitable for a wide range of applications, from website URLs to contact information.
QR code
  • MicroQRCode: The Micro QR Code is a smaller version of the standard QR code, designed for situations where space is limited. It can store less data than a standard QR code (up to 35 numeric characters or 21 alphanumeric characters), but its compact size makes it ideal for applications where a standard QR code would be too large, such as on small packaging or tiny printed labels.
QR code
  • RMQRCode: RMQR Code (Rectangular Micro QR Code) is another compact version of the QR code but in a rectangular shape rather than a square. This version allows for flexibility in its aspect ratio, which can be useful for applications where a rectangular space is available. It can store data similar to the Micro QR Code but is designed for specific use cases where the available space is non-square.
QR code