Re: How to open CMYK TIF in Cocoa?
Re: How to open CMYK TIF in Cocoa?
- Subject: Re: How to open CMYK TIF in Cocoa?
- From: Todd Freese <email@hidden>
- Date: Thu, 26 Jan 2012 20:21:30 -0600
The issue is that it only loads the pixels that are allowed by the alpha. Almost no graphic program does this. It should load "all" the pixels and give you the option of using the alpha if needed. Another words, there is no way to just get the full image.
From my research, the original TIFF spec did not allow for alpha when the file is CMYK. It did for RGB. It was later updated by Adobe to support it which is why some programs support it and others do not. At least that is what several web sites state.
You can't go the route of walking through the pixels and setting the alpha because the original data was already lost on file read. I ended up building and linking to libTIFF library which works like a champ.
Todd
On Jan 26, 2012, at 12:33 PM, Jens Alfke wrote:
>
> On Jan 26, 2012, at 8:25 AM, Todd Freese wrote:
>
>> The problem seems to be with the embedded alpha channel in the TIF. It is always using the alpha when you try to do anything with the file. Is there an easy way to avoid this? In my case, I need the full image without the alpha.
>
> Isn’t it the expected behavior for it to use the alpha channel if there’s one present? That doesn’t sound like a bug to me.
>
> If you want to strip out the alpha channel, you may need to load the image into a pixmap and then manually set the alpha component to 1.0 in all pixels. I’m not sure if there’s a graphics call to do this, or if you need to walk through the pixels in memory and manually OR 0xFF into the alpha component.
>
> —Jens
>
>
> ______________________________________________________________________
> This email has been scanned by the Symantec Email Security.cloud service.
> For more information please visit http://www.symanteccloud.com
> ______________________________________________________________________
______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________
_______________________________________________
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