Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make blur image on android? React-native

I need to do a blur effect on Image component on Android with react native, this is possible or how can i do it?

import React, { Component } from 'react';
import {
  StyleSheet,
  Text,
  View,
  Image,
} from 'react-native';

export default class Main extends Component {
  render() {
    return (
      <View style={styles.container}>
        <Image source={require('../../Images/bgImg.png')}
        style={styles.imagen}
        />
      </View>
    );
  }
}
like image 425
Jose Noriega Avatar asked Sep 09 '25 10:09

Jose Noriega


1 Answers

You can now set blurRadius property on your Image.

<Image
  style={styles.imagen}
  source={require('../../Images/bgImg.png')} 
  blurRadius={1}
/>

Or you can use a community library such as https://github.com/react-native-community/react-native-blur which works on both iOS and Android

like image 59
patngo Avatar answered Sep 11 '25 04:09

patngo