Home > OS >  Save Image to the camera roll in react native
Save Image to the camera roll in react native

Time:05-05

I want modify the contrast, sharpness, etc. of images. I am testing that with react-native-color-matrix-image-filters which seems to work fine. But I am not sure how to save the resulting images to the camera roll or how to get the base64 result. The following code will convert the original image to a greyscale image. How can I save the result?

import {
    Grayscale,
    Sepia,
    Tint,
    ColorMatrix,
    concatColorMatrices,
    invert,
    contrast,
    saturate
} from 'react-native-color-matrix-image-filters'


<View>
    <Grayscale>
       <Image style={styles.imgstyle}
            source={{
            uri: sourceImage,
        }}
        />
    </Grayscale>
</View>

CodePudding user response:

These module doesn't support save images (see here), you can use a combination of this module or react-native-image-filter-kit (for filters) and https://github.com/gre/react-native-view-shot to be able to download the image from your app

  • Related