Re: Reading RGBA pixel values from image on disk
Re: Reading RGBA pixel values from image on disk
- Subject: Re: Reading RGBA pixel values from image on disk
- From: Leonardo <email@hidden>
- Date: Thu, 10 Mar 2011 19:47:38 +0100
- Thread-topic: Reading RGBA pixel values from image on disk
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 <email@hidden>
> Data: Thu, 10 Mar 2011 09:48:32 -0800
> A: Leonardo <email@hidden>
> Cc: <email@hidden>
> 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 (email@hidden)
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:
This email sent to email@hidden