On Feb 24, 2014, at 10:25 AM, Kevin Meaney <k...@yvs.eu.com> wrote:

> 
> On 24 Feb 2014, at 18:04, Bill Dudney <bdud...@mac.com> wrote:
>> 
>> Make sure that what you are looking at is what you think you are looking at. 
>> When you look at it in Preview is it being scaled? If so then the default 
>> scaling algorithm in Preview for TIFF might be 'fast but ugly’ (I don’t 
>> know, just guessing). With a PNG it might be choosing a ‘nice but slower’ 
>> algorithm.
>> 
>> My recommendation would be to ensure you are looking at the image unscaled 
>> as both PNG and TIFF. In Preview I think the menu item is ‘Show Full Size’ 
>> or something like that.
> 
> I'd already done that, but doing it again made me realize that the problem is 
> 100% associated with the alpha channel. Where the pixels are fully opaque 
> everything is fine. Where pixels are semi-transparent is where the problem 
> occurs. Fully transparent is also fine. I wonder if the problem is to do with 
> premultiply. Does TIFF deal with an image generated from a premultiplied 
> bitmap properly?

How are you generating these images? Specifically, the CGImageRef you pass to 
CGImageDestination and the pixels backing it.

PNG does not store premultiplied image data, so the pixels will be 
un-multiplied for storage if necessary. TIFF does not seem to have a position 
on which form the data takes, but decoders may expect pre-multiplied since 
thats what Photoshop writes.

If your starting image is not pre-multiplied alpha, then the TIFF may be 
written the same way but decoded with a pre-multiplied assumption, which would 
make the image look horrible.

> 
>> If the docs are vague it would help to file a bug 
>> (http://bugreporter.apple.com) to make sure the people in charge of those 
>> docs get your input.
> 
> I wrote a bug report ages ago relating to the ImageIO documentation when I 
> had the same problem understanding the settings when creating gif animations 
> using CGImageDestination. I've not had any response to that bug report.
> 
> Thanks for the help.
> Kevin
> 
> 
> 
> _______________________________________________
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/david.duncan%40apple.com
> 
> This email sent to david.dun...@apple.com

--
David Duncan


_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to