(iphone) grayscaled image is too dark, can I change the opacity of gray scale image?
问题 I use the following code to turn color image to grayscale image. The resulting image is gray, but too dark. Can I change the opacity of it? (not sure if the term "opacity" is the right word for it) + (UIImage *)convertImageToGrayScale: (UIImage*) image { // Create image rectangle with current image width/height CGRect imageRect = CGRectMake(0, 0, image.size.width, image.size.height); // Grayscale color space CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray(); // Create bitmap content