Why is the Skia image not displaying the same as the original image?
`import {SafeAreaView, View, Image as RNImage, Text} from 'react-native'; import {Canvas, Image as SkiaImage, useImage} from '@shopify/react-native-skia';
const Test = () => { const skiaImage = useImage(require('../../assets/images/human.jpeg'));
return (
<SafeAreaView
style={{
flex: 1,
}}>
<View
style={{
flex: 1,
alignItems: 'center',
}}>
<RNImage
style={{
width: 300,
height: 300,
}}
source={require('../../assets/images/human.jpeg')}
resizeMode="contain"
/>
<Text>Skia Image:</Text>
<Canvas
style={{
width: 300,
height: 300,
}}>
<SkiaImage width={300} height={300} image={skiaImage} fit="contain" />
</Canvas>
</View>
</SafeAreaView>
); };
export default Test; `
Try to set sampling prop value to linear instead of nearest by default.
Try to set sampling prop value to
linearinstead ofnearestby default.
I added this line:
sampling={{ filter: FilterMode.Linear, mipmap: MipmapMode.Linear, }} but it didn't work.
We added support for sampling options and also p3 colors so now it should really be exactly the same.
the default sampling options are also now more sensible but let me know if you're still experiencing issues and send me the image as well as info on the platforms this potential issue might be occuring