lanczos

Lanczos Resampling error

空扰寡人 提交于 2019-12-11 04:19:03
问题 I have written an image resizer using Lanczos re-sampling. I've taken the implementation straight from the directions on wikipedia. The results look good visually, but for some reason it does not match the result from Matlab's resize with Lanczos very well (in pixel error). Does anybody see any errors? This is not my area of expertise at all... Here is my filter (I'm using Lanczos3 by default): double lanczos_size_ = 3.0; inline double sinc(double x) { double pi = 3.1415926; x = (x * pi); if

How can I fix a Core Image's CILanczosScaleTransform filter border artifact?

时光毁灭记忆、已成空白 提交于 2019-12-04 05:06:57
问题 I want to implement an image downscaling algorithm for iOS. After reading that Core Images's CILanczosScaleTransform was a great fit for it, I implemented it the following way: public func resizeImage(_ image: UIImage, targetWidth: CGFloat) -> UIImage? { assert(targetWidth > 0.0) let scale = Double(targetWidth) / Double(image.size.width) guard let ciImage = CIImage(image: image) else { fatalError("Couldn't create CIImage from image in input") } guard let filter = CIFilter(name:

How can I fix a Core Image's CILanczosScaleTransform filter border artifact?

怎甘沉沦 提交于 2019-12-02 04:07:16
I want to implement an image downscaling algorithm for iOS. After reading that Core Images's CILanczosScaleTransform was a great fit for it, I implemented it the following way: public func resizeImage(_ image: UIImage, targetWidth: CGFloat) -> UIImage? { assert(targetWidth > 0.0) let scale = Double(targetWidth) / Double(image.size.width) guard let ciImage = CIImage(image: image) else { fatalError("Couldn't create CIImage from image in input") } guard let filter = CIFilter(name: "CILanczosScaleTransform") else { fatalError("The filter CILanczosScaleTransform is unavailable on this device.") }

Android: Bitmap resizing using better resampling algorithm than bilinear (like Lanczos3)

大城市里の小女人 提交于 2019-11-28 06:52:59
Is there any way or external library that can resize image using Lanczos (ideally) or at least bicubic alg. under Android ? ( faster is better of course, but quality is priority, a processing time is secondary) Everything what I've got so far is this: Bitmap resized = Bitmap.createScaledBitmap(yourBitmap, newWidth, newHeight, true); However it uses bilinear filter and the output quality is terrible. Especially if you want to preserve details (like thin lines or readable texts). There are many good libraries for Java as discussed for example here: Java - resize image without losing quality

Android: Bitmap resizing using better resampling algorithm than bilinear (like Lanczos3)

折月煮酒 提交于 2019-11-27 01:39:36
问题 Is there any way or external library that can resize image using Lanczos (ideally) or at least bicubic alg. under Android ? ( faster is better of course, but quality is priority, a processing time is secondary) Everything what I've got so far is this: Bitmap resized = Bitmap.createScaledBitmap(yourBitmap, newWidth, newHeight, true); However it uses bilinear filter and the output quality is terrible. Especially if you want to preserve details (like thin lines or readable texts). There are many