Apr
7
Day 38: PNGRepresentationWithInterlaced
NSImage’s TIFFRepresentation is nice, but they are quite big. PNG’s are always smaller and that’s why I have this little category on NSImage:
- (NSData *)PNGRepresentationWithInterlaced:(BOOL)interlaced
{
NSBitmapImageRep *imageRep = [NSBitmapImageRep imageRepWithData:[self TIFFRepresentation]];
return [imageRep PNGRepresentationWithInterlaced:interlaced];
}