globchastyy / swiftuiimageeffects Goto Github PK
View Code? Open in Web Editor NEWSwift port of Apple UIImage+UIImageEffecs category.
Swift port of Apple UIImage+UIImageEffecs category.
change line 210 to radius += 1 instead of radius += 1.0
Nice to have a Swift version, but do some time profiling and you'll find it is much, much slower than the Objective-C version. Setting a blur radius of 20 with no tint or saturation to my image takes 96 ms with the Objective-C version. This Swift version takes 1106 ms!
Even when I don't apply any blur, tint, or saturation, it's still slower. In my case, it takes 322 ms to apply no effect. This is compared to 36 ms from the Objective-C version with the same image and settings.
I'm using this method "UIImage(named: "TestBigImage")?.applyDarkEffect()" and when the view is going to be loaded, the iphone reboot.
Using the Obj C version, I'm able to apply a blur to the image like so:
effectImage = [self.image applyBlurWithRadius:15.0 tintColor:[UIColor colorWithWhite:1.0 alpha:0.2] saturationDeltaFactor:1.2 maskImage:self.image];
When I try to do the same thing with your Swift version, thus:
imageView.image = image.applyBlurWithRadius(15.0, tintColor: UIColor(white: 1.0, alpha: 0.2), saturationDeltaFactor: 1.2, maskImage: image)
.. I get an interesting effect, but it's definitely not a blur. Am I calling it correctly?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.