CGImage represents a drawable image object in Core Graphics (the low-level procedural drawing API for iOS and Mac OS X).
Questions tagged [cgimage]
563 questions
4
votes
1 answer
Need to release a CGImage contained in a CALayer's contents property
I have a CALayer object called sublayer. I use it as self.sublayer throughout my view controller because I have made it a property in my view controller's header file.
I set the sublayer's contents property equal to a UIImage object that is created…

user3344977
- 3,584
- 4
- 32
- 88
4
votes
0 answers
What's the most efficient way to get a decoded CGImage from a JPEG backed CGImage?
I was surprised today that a JPEG backed CGImage backed CALayer (I mean a [[JPEG backed CGImage] backed CALayer]) was so slow that for a 8MP photo it felt no GPU there.
I tried creating a new bitmap backed CGImage by drawing the original CGImage…

BlueWanderer
- 2,671
- 2
- 21
- 36
4
votes
2 answers
Importing multiple images of original resolution : low memory warning issue
I am using ChuteSDK to import multiple images from photo library something like this:
-(void)doneSelected{
NSMutableArray *returnArray = [NSMutableArray array];
[self showHUD];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH,…

Ankur Arya
- 4,693
- 5
- 29
- 50
4
votes
3 answers
How to tell if CGImageRef is completely blank?
I'm writing an Objective-C algorithm that compares two images and outputs the differences.
Occasionally two identical images will be passed in. Is there a way to tell immediately from the resulting CGImageRef that it contains no data? (i.e. only…

Chris Nolet
- 8,714
- 7
- 67
- 92
4
votes
3 answers
How do I create a mutable array of CGImageRefs?
I want to keep a mutable collection of CGImageRefs. Do I need to wrap them in NSValue, and if so how do I wrap and unwrap them properly? Can I get away with using a C array? If so how do I construct it and how do I add elements to it later? Is it…

RexOnRoids
- 14,002
- 33
- 96
- 136
4
votes
2 answers
Using GL_UNSIGNED_SHORT_1_5_5_5_REV on iPhone
I've been suffering from severe performance problems rendering a regularly updated image to the iphone. After trying it on the iPad 3 today I found out that I was only getting 2fps. This was WAAAY too slow. As such I decided to profile and found…

Goz
- 61,365
- 24
- 124
- 204
4
votes
2 answers
Loading UIImage and deleting original file
I'm trying to load an image store in locally and then delete original file.
so here the code:
UIImage *workingCopy = [UIImage imageWithContentsOfFile:workingCopyPath];
NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *error =…

OgreSwamp
- 4,602
- 4
- 33
- 54
4
votes
1 answer
CGImage creates a lot of dirty memory causing the app to crash
I try to create a UIImage by filling in my own data. So far everything works fine. But if I try to call this function several times it seems to fill the memory till the App crashes. Using the VM Tracker I found out that the dirty memory grows up to…

David Burri
- 43
- 4
3
votes
0 answers
TextureWithCGImage crashing iOS
I'm trying to texture an OpenGL object with a video. It's almost done but I have a crash with my textureWithCGImage method and I don't know why.
CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);
// Lock the…

Pierre
- 10,593
- 5
- 50
- 80
3
votes
3 answers
CGImage rotation method memory leak on iOS
I have this code to rotate CGImage:
- (CGImageRef)rotateCGImageRef:(CGImageRef)imageRef toOrientation:(UIImageOrientation)orientation
{
CGRect bnds = CGRectZero;
CGImageRef copy = nil;
CGContextRef ctxt = nil;
…

Borut Tomazin
- 8,041
- 11
- 78
- 91
3
votes
1 answer
32 bits big endian floating point data to CGImage
I am trying to write an application which read FITS image. FITS stand for Flexible Image Transport format and it is a format wish is primarily used to store scientific data related to astrophysics, and secondarily, it is used by most amator…

William GILLARD
- 107
- 9
3
votes
2 answers
CGImage orientation issues when retrieved from ALAssset
I am just starting to learn iPhone app development. I am trying to retrieve photos from my photo album using ALAsset class and upload the photos to my server. However, the photos that were taken in the Portrait mode are rotated 90 degrees to the…

Balaji Krishnan
- 101
- 3
- 5
3
votes
1 answer
Fasted way to detect and remove transparent space around NSImage
What is the fastest way to trim an image (NSImage or CGImageRef) so that all transparent areas around the image are removed?
I'd imagine I could look at each pixel starting from the top and determine its alpha value, but maybe there's another…

Mark
- 1,447
- 2
- 14
- 26
3
votes
1 answer
Can I edit the Alpha Mask of a UIImage in a UIImageView without have to move too much memory?
I want to take a image (a brush) and draw it into a displayed image. I only want to affect the alpha of that image, and I need to export it later.
From what I've seen, most directions only really get into some costly looking operations that don't…

napierzaza
- 439
- 5
- 21
3
votes
1 answer
CGImage Masking stopped working on iOS 12
I've got a method for masking a B&W image by cutting out (i.e. making transparent) any pixels that are above or below a certain brightness. The result would be the same B&W image, but with everything above 70% or below 25% brightness (or whatever…

Nerrolken
- 1,975
- 3
- 24
- 53