I forgot: if I save the TIF from Photoshop marking the check-box "Save Transparency", on my App I can quite read the alpha channel, and the RGB values are not pre-multiplied. That's fine. Anyway, without the "Save Transparency", on my App I get the RGB values pre-multiplied and the alpha values are all 1.0, so I can't calculate the original RGB values. The weird point is that if I re-open this TIF file with Photoshop, the half-a-transparent pixels are well visible. So the alpha information has been properly stored within the TIF file, somewhere. I would like to know where.
I am sure the representation still contains the alpha info because if I save it to the disk as png, I can quite re-open this png with Photoshop and see those half-a-transparent pixels. bitmapData = [imageRep representationUsingType:NSPNGFileType properties:[NSDictionary dictionaryWithObject:[NSColorSpace deviceRGBColorSpace] forKey:NSImageColorSyncProfileData]]; [bitmapData writeToFile:@"/image.png" atomically:YES]; Regards -- Leonardo > Da: Quincey Morris <quinceymor...@earthlink.net> > Data: Thu, 10 Mar 2011 09:48:32 -0800 > A: Leonardo <mac.iphone....@gmail.com> > Cc: <cocoa-dev@lists.apple.com> > Oggetto: Re: Reading RGBA pixel values from image on disk > > On Mar 10, 2011, at 09:25, Leonardo wrote: > >> if I re-open the same TIF file with Photoshop, I can quite see the >> half-a-transparent pixels. So, it seems that the alpha information has been >> properly saved within the TIF file. I would like to know how to manage a >> file like this and retrieve the transparency (alpha) of those pixels. >> >> I can send you this TIF file, if you agree. It's only 42KB. > > I don't have access to any better tools for examining TIFF files than you do. > All I'm saying is that the NSImageRef is telling you there's no alpha > (assuming it also says 8 bits per pixel), and I think if NSImage were unable > to load transparent TIFF images we'd have heard about it by now. > > Keep in mind that TIFF files may contain multiple image representations. Did > you check for others in the NSImage? > > _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com