【问题标题】:How to perform image processing in ios如何在ios中进行图像处理
【发布时间】:2014-07-31 09:16:18
【问题描述】:

我有一张名为myImage.jpg 的图片 我必须对图像进行以下动画处理,并将最终结果放在 iOS 中的 imageView 中。要求是:

  1. 调整为 262%。
  2. 复制图层。
  3. 垂直翻转。
  4. 将复制层与第一层的底部对齐。
  5. 对复制图层应用高斯模糊(值 - 9)。
  6. 将模糊层(复制层)向上移动 47px
  7. 在模糊图层上添加了图层蒙版。
  8. 将渐变应用到从黑色到白色的遮罩层。

如何在图像上做这些动画。我已经使用

完成了垂直翻转
- (UIImage *) flipImage: (UIImage *) image {
    UIImage *flippedImage = [UIImage imageWithCGImage:image.CGImage scale:image.scale orientation:UIImageOrientationDownMirrored];
    return flippedImage;
}

并使用以下代码进行模糊处理:

CIFilter *filter = [CIFilter filterWithName:@"CIGaussianBlur"];
[filter setValue:inputImage forKey:kCIInputImageKey];
[filter setValue:[NSNumber numberWithFloat:3.0f] forKey:@"inputRadius"];

如何创建蒙版和渐变以及如何组合这些图像?

【问题讨论】:

    标签: ios image-processing uiimage


    【解决方案1】:

    我解决了这个问题。通过为原始图像、翻转模糊图像、顶部和底部渐变生成单独的图像,并使用它们进行组合

    UIGraphicsBeginImageContext(size)
    

    方法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-12-01
      • 2012-07-30
      • 2021-12-23
      • 2013-10-11
      • 1970-01-01
      • 1970-01-01
      • 2019-07-08
      • 1970-01-01
      相关资源
      最近更新 更多