Library for generate images from other images
yarn add react-native-image-generator
import { generate } from 'react-native-image-generator';
// ...
const r = await generate(
[
{
uri: 'https://picsum.photos/200/300',
width: 200,
height: 300,
x: 0,
y: 0,
},
{
uri: 'Mario', // named asset or assets file in android
width: 200,
height: 300,
x: 0,
y: 0,
},
{
text: 'DESIGN',
fontSize: 23,
width: 300,
height: 300,
x: 50,
y: 50,
color: [0, 255, 0, 1.0],
fontFamily: Platform.OS === 'ios' ? 'Helvetica' : 'Roboto',
},
],
{
filename: 'test.png',
width: 200,
height: 300,
}
);
To use local image you need to put it in assets
In iOS you need to put it Images:
Make sure that your file placed here android/app/src/main/assets/
. For example:
android/app/src/main/assets/Mario
- iOS
- Android
MIT