gpt4 book ai didi

ios - 如何增加/减少UIImage的亮度,并且需要保存生成的图像?

转载 作者:行者123 更新时间:2023-12-01 17:39:43 30 4
gpt4 key购买 nike

我有一个图像,我想更改其亮度,我需要保存从实际图像获得的结果图像,我该怎么做。我想使用UIslider增加亮度吗?

最佳答案

从Github中获取UIImage类别here的代码。

要使图像变亮,请编写如下代码:

//brighten value can be obtained from slider change event from -255 to 255.
UIImage* brightImage = [originalImage brightenWithValue:sliderValue];

//Convert image into data
NSData *brightImageData = UIImagePNGRepresentation(brightImage);

//Get the path of Documents directory and store the data object to proper file

关于ios - 如何增加/减少UIImage的亮度,并且需要保存生成的图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24080435/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com