I have checked with imageRepsWithContentsOfFile
which returns an array with one object only.
So, there is one only representation.
These are some values I get from the representation

representations count 1
colorSpaceA sRGB IEC61966-2.1 colorspace
isPlanar 0
numberOfPlanes 1
NSAlphaNonpremultipliedBitmapFormat 0
hasAlpha 0
bitsPPixel 24
bytesPerPixel 3

The pixel I have set on Photoshop as RGBA
    0.00, 1.00, 0.00, 0.20
becomes in my App as
    0.80, 1.00, 0.80, 1.00
which clearly means it has been pre-multiplied by a white opaque color
    1.00, 1.00, 1.00, 1.00
final = (src * 0.2) + (dst * (1.0 - 0.2))

I would like to know where the alpha info has gone within the file, so I
could divide the RGB values by the alpha value. Any idea?


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

Reply via email to