[ad_1]
I’ve a picture (outlined in pink) displaying the results of ImageRenderer referred to as on a canvas. I need to invert the colours such that the tiny ensuing picture is white textual content on a black background. I’ve tried varied strategies from stackoverflow to invert the colours however every leads to a clean consequence. I am pretty new to Swift and iOS growth, whats the simplest technique to invert the colours of that smaller consequence picture?
Button(motion: {
guard let picture = ImageRenderer(content material: canvas).uiImage else {
// did not render view as picture
return
}
UIImageWriteToSavedPhotosAlbum(picture, nil, nil, nil)
resultImage = Picture(uiImage: picture)
}){
Textual content("Analyze")
}
[ad_2]

