react-native-image-picker vs react-native-vision-camera vs react-native-camera vs react-native-qrcode-scanner vs react-native-camera-kit
React Native Camera Libraries Comparison
1 Year
react-native-image-pickerreact-native-vision-camerareact-native-camerareact-native-qrcode-scannerreact-native-camera-kitSimilar Packages:
What's React Native Camera Libraries?

These libraries provide various functionalities for integrating camera features into React Native applications. They enable developers to access the device's camera for capturing images, scanning QR codes, and more. Each library has its unique features and use cases, catering to different needs in mobile app development.

Package Weekly Downloads Trend
Github Stars Ranking
Stat Detail
Package
Downloads
Stars
Size
Issues
Publish
License
react-native-image-picker324,6788,519188 kB308a month agoMIT
react-native-vision-camera209,0798,0391.16 MB218a month agoMIT
react-native-camera82,7559,642-1444 years agoMIT AND Apache-2.0 AND BSD-3-Clause
react-native-qrcode-scanner22,5152,03537.1 kB123-MIT
react-native-camera-kit15,6952,529350 kB1022 months agoMIT
Feature Comparison: react-native-image-picker vs react-native-vision-camera vs react-native-camera vs react-native-qrcode-scanner vs react-native-camera-kit

Camera Functionality

  • react-native-image-picker:

    Focuses on image and video selection from the device's library or capturing new media. It does not provide direct camera control but simplifies the process of accessing media.

  • react-native-vision-camera:

    Delivers high-performance camera access with features like frame processing and custom camera controls. It is designed for applications that require advanced camera capabilities and real-time processing.

  • react-native-camera:

    Provides extensive camera functionalities including photo and video capture, barcode scanning, and face detection. It supports various camera configurations and allows for advanced features like custom overlays and camera controls.

  • react-native-qrcode-scanner:

    Specialized for QR code scanning, it provides a straightforward interface for scanning QR codes with minimal setup. It is optimized for quick scanning and user-friendly integration.

  • react-native-camera-kit:

    Offers basic camera functionalities such as photo and video capture with a simple API. It is designed for quick integration and ease of use, making it suitable for straightforward camera applications.

Ease of Integration

  • react-native-image-picker:

    Extremely easy to integrate, requiring only a few lines of code to set up. It is user-friendly and ideal for developers looking for quick media selection capabilities.

  • react-native-vision-camera:

    While it offers advanced features, it may require more setup and understanding of camera concepts. However, it provides comprehensive documentation to assist developers.

  • react-native-camera:

    Requires a more complex setup due to its extensive features, but provides detailed documentation for integration. It may involve more configuration compared to simpler libraries.

  • react-native-qrcode-scanner:

    Very easy to implement with minimal configuration required. It allows developers to quickly add QR code scanning functionality to their applications.

  • react-native-camera-kit:

    Designed for easy integration with minimal setup. It provides a straightforward API that allows developers to get started quickly without extensive configuration.

Performance

  • react-native-image-picker:

    Performance is generally good as it relies on the native image picker, but it may vary based on the device and the number of images being processed.

  • react-native-vision-camera:

    High-performance library that supports real-time frame processing, making it suitable for applications requiring low-latency camera access and advanced features.

  • react-native-camera:

    Offers good performance for most use cases, but may experience lag with extensive processing or high-resolution video capture. Optimizations can be made for better performance in demanding scenarios.

  • react-native-qrcode-scanner:

    Optimized for quick QR code scanning, providing fast performance with minimal lag. It is designed for real-time scanning applications.

  • react-native-camera-kit:

    Lightweight and performs well for basic camera functionalities. It is optimized for speed and efficiency, making it suitable for applications with simple camera needs.

Community and Support

  • react-native-image-picker:

    Widely used with a large community, ensuring plenty of resources and support are available. Documentation is clear and helpful for integration.

  • react-native-vision-camera:

    Growing community with active development and support. The documentation is comprehensive, making it easier for developers to implement advanced features.

  • react-native-camera:

    Has a large community and extensive documentation, providing good support for developers. Many resources and examples are available to assist with implementation.

  • react-native-qrcode-scanner:

    Has a smaller community but is straightforward enough that developers can easily find help. Documentation is concise and focused on QR code scanning.

  • react-native-camera-kit:

    Smaller community compared to react-native-camera, but still offers decent support and documentation for basic functionalities.

Use Cases

  • react-native-image-picker:

    Perfect for applications that need to allow users to select images or videos from their gallery or capture new media, such as social media apps.

  • react-native-vision-camera:

    Designed for high-performance applications that require real-time camera processing, such as augmented reality, machine learning, or custom camera functionalities.

  • react-native-camera:

    Ideal for applications requiring comprehensive camera functionalities, such as photo and video apps, augmented reality, and barcode scanning applications.

  • react-native-qrcode-scanner:

    Tailored for apps focused on QR code scanning, such as payment systems, ticketing apps, or any application that requires quick access to QR code functionalities.

  • react-native-camera-kit:

    Best suited for simple camera applications where quick integration is a priority, such as basic photo capture apps.

How to Choose: react-native-image-picker vs react-native-vision-camera vs react-native-camera vs react-native-qrcode-scanner vs react-native-camera-kit
  • react-native-image-picker:

    Opt for react-native-image-picker when you need to allow users to select images or videos from their device's gallery or capture new media using the camera. It is best for applications that require media selection rather than extensive camera control.

  • react-native-vision-camera:

    Choose react-native-vision-camera for high-performance camera access with an emphasis on modern features like frame processing and advanced camera controls. It is suited for applications that require real-time processing and custom camera functionalities.

  • react-native-camera:

    Choose react-native-camera if you need a comprehensive solution that supports both photo and video capture, as well as advanced features like face detection and barcode scanning. It is suitable for applications requiring extensive camera functionalities.

  • react-native-qrcode-scanner:

    Use react-native-qrcode-scanner if your primary requirement is to scan QR codes quickly and efficiently. This library is tailored for QR code scanning and is easy to implement, making it perfect for apps focused on QR code functionalities.

  • react-native-camera-kit:

    Select react-native-camera-kit for a simpler and more lightweight camera solution that focuses on ease of use and quick integration. It's ideal for projects that need basic camera functionalities without the overhead of additional features.

README for react-native-image-picker

react-native-image-picker πŸŽ†

A React Native module that allows you to select a photo/video from the device library or camera.

npm downloads npm package License

Installation

yarn add react-native-image-picker

New Architecture

To take advantage of the new architecture run-

iOS

RCT_NEW_ARCH_ENABLED=1 npx pod-install ios

Android

Set newArchEnabled to true inside android/gradle.properties

Pre-Fabric (AKA not using the new architecture)

npx pod-install ios

Post-install Steps

iOS

Add the appropriate keys to your Info.plist depending on your requirement:

| Requirement | Key | | ------------------------------ | --------------------------------------------------- | | Select image/video from photos | NSPhotoLibraryUsageDescription | | Capture Image | NSCameraUsageDescription | | Capture Video | NSCameraUsageDescription & NSMicrophoneUsageDescription |

Android

No permissions required (saveToPhotos requires permission check).

Note: This library does not require Manifest.permission.CAMERA, if your app declares as using this permission in manifest then you have to obtain the permission before using launchCamera.

Targeting Android API Levels Below 30

If your app's minSdkVersion is set to below 30 and it does not already include or depend on androidx.activity:activity:1.9.+ or a newer version, you'll need to add the following line to the dependencies section of your app/build.gradle file to ensure support for the backported AndroidX Photo Picker:

dependencies {
    ...
    implementation("androidx.activity:activity:1.9.+")
    ...
}

Additionally, you may need to update your AndroidManifest.xml to trigger the installation of the backported Photo Picker. For reference, you can check the example app's configuration in example/android/app/src/main/AndroidManifest.xml and example/android/app/build.gradle.

For more details, consult the Android documentation on AndroidX Photo Picker: https://developer.android.com/training/data-storage/shared/photopicker

API Reference

Methods

import {launchCamera, launchImageLibrary} from 'react-native-image-picker';

launchCamera()

Launch camera to take photo or video.

launchCamera(options?, callback);

// You can also use as a promise without 'callback':
const result = await launchCamera(options?);

See Options for further information on options.

The callback will be called with a response object, refer to The Response Object.

launchImageLibrary

Launch gallery to pick image or video.

launchImageLibrary(options?, callback)

// You can also use as a promise without 'callback':
const result = await launchImageLibrary(options?);

See Options for further information on options.

The callback will be called with a response object, refer to The Response Object.

Options

| Option | iOS | Android | Web | Description | | ----------------------- | --- | ------- | --- |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | mediaType | OK | OK | OK | photo or video or mixed(launchCamera on Android does not support 'mixed'). Web only supports 'photo' for now. | | maxWidth | OK | OK | NO | To resize the image. | | maxHeight | OK | OK | NO | To resize the image. | | videoQuality | OK | OK | NO | low, medium, or high on iOS, low or high on Android. | | durationLimit | OK | OK | NO | Video max duration (in seconds). | | quality | OK | OK | NO | 0 to 1, photos. | | conversionQuality | NO | OK | NO | For conversion from HEIC/HEIF to JPEG, 0 to 1. Default is 0.92 | | cameraType | OK | OK | NO | 'back' or 'front' (May not be supported in few android devices). | | includeBase64 | OK | OK | OK | If true, creates base64 string of the image (Avoid using on large image files due to performance). | | includeExtra | OK | OK | NO | If true, will include extra data which requires library permissions to be requested (i.e. exif data). | | saveToPhotos | OK | OK | NO | (Boolean) Only for launchCamera, saves the image/video file captured to public photo. | | selectionLimit | OK | OK | OK | Supports providing any integer value. Use 0 to allow any number of files on iOS version >= 14 & Android version >= 13. Default is 1. | | presentationStyle | OK | NO | NO | Controls how the picker is presented. currentContext, pageSheet, fullScreen, formSheet, popover, overFullScreen, overCurrentContext. Default is currentContext. | | formatAsMp4 | OK | NO | NO | Converts the selected video to MP4 (iOS Only). | | assetRepresentationMode | OK | OK | NO | A mode that determines which representation to use if an asset contains more than one on iOS or disables HEIC/HEIF to JPEG conversion on Android if set to 'current'. Possible values: 'auto', 'current', 'compatible'. Default is 'auto'. |

The Response Object

| key | iOS | Android | Web | Description | | ------------ | --- | ------- | --- | ------------------------------------------------------------------- | | didCancel | OK | OK | OK | true if the user cancelled the process | | errorCode | OK | OK | OK | Check ErrorCode for all error codes | | errorMessage | OK | OK | OK | Description of the error, use it for debug purpose only | | assets | OK | OK | OK | Array of the selected media, refer to Asset Object |

Asset Object

| key | iOS | Android | Web | Photo/Video | Requires Permissions | Description | | --------- | --- | ------- | --- | ----------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | base64 | OK | OK | OK | PHOTO ONLY | NO | The base64 string of the image (photos only) | | uri | OK | OK | OK | BOTH | NO | The file uri in app specific cache storage. Except when picking video from Android gallery where you will get read only content uri, to get file uri in this case copy the file to app specific storage using any react-native library. For web it uses the base64 as uri. | | originalPath | NO | OK | NO | BOTH | NO | The original file path. | | width | OK | OK | OK | BOTH | NO | Asset dimensions | | height | OK | OK | OK | BOTH | NO | Asset dimensions | | fileSize | OK | OK | NO | BOTH | NO | The file size | | type | OK | OK | NO | BOTH | NO | The file type | | fileName | OK | OK | NO | BOTH | NO | The file name | | duration | OK | OK | NO | VIDEO ONLY | NO | The selected video duration in seconds | | bitrate | --- | OK | NO | VIDEO ONLY | NO | The average bitrate (in bits/sec) of the selected video, if available. (Android only) | | timestamp | OK | OK | NO | BOTH | YES | Timestamp of the asset. Only included if 'includeExtra' is true | | id | OK | OK | NO | BOTH | YES | local identifier of the photo or video. On Android, this is the same as fileName |

Note on file storage

Image/video captured via camera will be stored in temporary folder allowing it to be deleted any time, so don't expect it to persist. Use saveToPhotos: true (default is false) to save the file in the public photos. saveToPhotos requires WRITE_EXTERNAL_STORAGE permission on Android 28 and below (The permission has to obtained by the App manually as the library does not handle that).

For web, this doesn't work.

ErrorCode

| Code | Description | | ------------------ | ------------------------------------------------- | | camera_unavailable | Camera not available on device | | permission | Permission not satisfied | | others | Other errors (check errorMessage for description) |

License

MIT