Skip to content

Instantly share code, notes, and snippets.

@jarek-foksa
Created February 26, 2013 04:25
Show Gist options
  • Select an option

  • Save jarek-foksa/5035863 to your computer and use it in GitHub Desktop.

Select an option

Save jarek-foksa/5035863 to your computer and use it in GitHub Desktop.
NSDictionary *dictionary = [NSDictionary dictionaryWithObjects:@[@"1.0"] forKeys:@[@"NSImageCompressionFactor"]];
NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithData:[img TIFFRepresentation]];
NSData *png = [imageRep representationUsingType:NSPNGFileType properties:dictionary];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment