react-native-image-picker vs react-native-vision-camera vs expo-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-cameraexpo-camerareact-native-camerareact-native-qrcode-scannerreact-native-camera-kitSimilar Packages:
What's React Native Camera Libraries?

These libraries provide various functionalities for accessing and utilizing the camera on mobile devices within React Native applications. They cater to different use cases, such as capturing images, scanning QR codes, and managing camera functionalities with varying levels of complexity and performance. Understanding their unique features and capabilities is essential for selecting the right library for your project needs.

Package Weekly Downloads Trend
Github Stars Ranking
Stat Detail
Package
Downloads
Stars
Size
Issues
Publish
License
react-native-image-picker324,6788,519188 kB30810 days agoMIT
react-native-vision-camera209,0798,0391.16 MB2186 days agoMIT
expo-camera181,33037,672490 kB7917 days agoMIT
react-native-camera82,7559,642-1443 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 kB10215 days agoMIT
Feature Comparison: react-native-image-picker vs react-native-vision-camera vs expo-camera vs react-native-camera vs react-native-qrcode-scanner vs react-native-camera-kit

Camera Functionality

  • react-native-image-picker:

    React Native Image Picker is not a camera library per se but allows users to pick images and videos from their device's gallery or capture new media using the camera. It simplifies the media selection process, providing a straightforward interface for users to access their media files.

  • react-native-vision-camera:

    React Native Vision Camera is aimed at high-performance applications, providing advanced camera controls and real-time frame processing capabilities. It is suitable for applications that require high-quality camera output and extensive customization options.

  • expo-camera:

    Expo Camera provides a simple API for accessing the device camera, allowing for photo and video capture, along with support for various camera settings like flash, zoom, and aspect ratio. It is designed to work seamlessly within the Expo ecosystem, making it easy to integrate with other Expo features.

  • react-native-camera:

    React Native Camera offers a rich set of camera functionalities, including support for barcode scanning, face detection, and customizable camera UI. It allows developers to create complex camera interfaces and manage camera settings extensively, making it suitable for applications with advanced camera requirements.

  • react-native-qrcode-scanner:

    React Native QRCode Scanner is specialized for scanning QR codes, providing a simple interface to initiate scanning and handle results. It is designed for quick integration into applications that require QR code functionality without additional camera features.

  • react-native-camera-kit:

    React Native Camera Kit is focused on simplicity and ease of use, providing basic camera functionalities such as image capturing and QR code scanning without the need for extensive configuration. It is ideal for developers looking for a lightweight solution for simple camera tasks.

Performance

  • react-native-image-picker:

    React Native Image Picker performs well for media selection tasks, but it relies on the native image picker implementations of iOS and Android, which may have performance variations based on the platform and device.

  • react-native-vision-camera:

    React Native Vision Camera is built for high performance, supporting real-time image processing and advanced camera controls. It is suitable for applications that require low latency and high-quality camera output.

  • expo-camera:

    Expo Camera is optimized for performance within the Expo framework, but it may not offer the same level of performance as native solutions for complex applications. It is suitable for most standard use cases but may have limitations in high-demand scenarios.

  • react-native-camera:

    React Native Camera is designed for performance and can handle various camera tasks efficiently. However, performance may vary depending on the device and specific features used, so testing on target devices is recommended for optimal results.

  • react-native-qrcode-scanner:

    React Native QRCode Scanner is efficient for QR code scanning and is optimized for quick scanning tasks. It is lightweight and performs well in scenarios focused solely on QR code functionality.

  • react-native-camera-kit:

    React Native Camera Kit is lightweight and performs well for basic camera tasks, but it may not support advanced features that could impact performance in more complex scenarios. It is ideal for applications with minimal camera requirements.

Ease of Use

  • react-native-image-picker:

    React Native Image Picker is user-friendly and straightforward, allowing developers to implement media selection with minimal effort. Its API is simple and easy to understand, making it accessible for all skill levels.

  • react-native-vision-camera:

    React Native Vision Camera may have a steeper learning curve due to its advanced features and capabilities. Developers may need to invest time in understanding its API and performance optimizations.

  • expo-camera:

    Expo Camera is easy to use, especially for developers already familiar with the Expo ecosystem. Its API is straightforward, making it accessible for beginners and quick to implement in projects.

  • react-native-camera:

    React Native Camera has a steeper learning curve due to its extensive features and customization options. While powerful, it may require more time to understand and implement effectively.

  • react-native-qrcode-scanner:

    React Native QRCode Scanner is very easy to implement, requiring minimal setup to get started with QR code scanning. It is suitable for developers looking for quick integration of scanning functionality.

  • react-native-camera-kit:

    React Native Camera Kit is designed for simplicity, making it easy for developers to set up and use without extensive configuration. It is ideal for those who want a quick and hassle-free camera solution.

Community and Support

  • react-native-image-picker:

    React Native Image Picker has a strong community and is well-documented, providing ample resources for developers. It is actively maintained, ensuring compatibility with the latest React Native versions.

  • react-native-vision-camera:

    React Native Vision Camera is gaining popularity and has a growing community. It offers good documentation and resources, but being a newer library, it may have fewer community-contributed resources compared to more established libraries.

  • expo-camera:

    Expo Camera benefits from the strong Expo community and extensive documentation, providing good support and resources for developers. It is regularly updated and maintained as part of the Expo ecosystem.

  • react-native-camera:

    React Native Camera has a large community and is widely used, resulting in a wealth of resources, tutorials, and community support. However, some issues may arise due to its extensive feature set, requiring community engagement for troubleshooting.

  • react-native-qrcode-scanner:

    React Native QRCode Scanner has a smaller community, but it is straightforward to use, and documentation is available. Support may be limited compared to larger libraries, but it is sufficient for basic use cases.

  • react-native-camera-kit:

    React Native Camera Kit has a smaller community compared to others, but it is still supported by its maintainers. Documentation is available, but resources may be limited compared to more popular libraries.

Platform Compatibility

  • react-native-image-picker:

    React Native Image Picker is compatible with both iOS and Android, leveraging the native image picker implementations for each platform, ensuring a familiar user experience.

  • react-native-vision-camera:

    React Native Vision Camera supports both iOS and Android, offering advanced features and performance optimizations tailored for each platform.

  • expo-camera:

    Expo Camera is designed to work seamlessly across both iOS and Android platforms within the Expo framework, ensuring consistent behavior and functionality across devices.

  • react-native-camera:

    React Native Camera supports both iOS and Android, but developers should test on both platforms to ensure consistent performance and behavior due to potential platform-specific differences.

  • react-native-qrcode-scanner:

    React Native QRCode Scanner works on both iOS and Android, providing consistent QR code scanning capabilities across platforms with minimal configuration.

  • react-native-camera-kit:

    React Native Camera Kit is compatible with both iOS and Android, providing a consistent experience across platforms for basic camera functionalities.

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

    Use React Native Image Picker when your primary requirement is to allow users to select images or videos from their device's gallery or capture new media using the camera, providing a straightforward interface for media selection.

  • react-native-vision-camera:

    Select React Native Vision Camera for high-performance camera access with advanced features like frame processing and camera controls, suitable for applications that require real-time image processing and high-quality camera output.

  • expo-camera:

    Choose Expo Camera if you are using the Expo framework and want a straightforward solution for camera access with built-in support for image and video capture, as well as easy integration with other Expo features.

  • react-native-camera:

    Select React Native Camera for a comprehensive camera solution that supports advanced features like barcode scanning, face detection, and customizable camera UI, making it suitable for applications requiring extensive camera functionalities.

  • react-native-qrcode-scanner:

    Choose React Native QRCode Scanner if your application specifically needs to scan QR codes easily and efficiently, with minimal setup and a focus on scanning capabilities.

  • react-native-camera-kit:

    Opt for React Native Camera Kit if you need a simple and lightweight camera solution with a focus on ease of use and quick setup, ideal for basic image capturing and QR code scanning without extensive configuration.

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