Re: Final round with NSTIFFCompressionCCITTFAX3
Re: Final round with NSTIFFCompressionCCITTFAX3
- Subject: Re: Final round with NSTIFFCompressionCCITTFAX3
- From: Cameron Hayne <email@hidden>
- Date: Thu, 12 Sep 2002 00:28:02 -0400
On Wednesday, September 11, 2002, at 10:32 pm, Ben Mackin wrote:
I am not sure on the algorithm to convert to black and white, but I
heard it
is pretty difficult.
It shouldn't be that difficult. Seem to me you could do it with
something like the following method posted by Andrew Zamler-Carhart:
(
http://cocoa.mamasam.com/MACOSXDEV/2002/08/2/42969.php)
@implementation NSColor (DarkColor)
- (BOOL) isDarkerThan: (float) lightness {
NSColor *monoColor = [self colorUsingColorSpaceName:
@"NSCalibratedWhiteColorSpace"];
return ([monoColor whiteComponent] < lightness);
}
Two more points:
1) I too am surprised that this sort of image format conversion isn't
available via some Cocoa API.
2) You should tell us what your reason for all this is - since maybe
there is an easier way of achieving your higher-level goals. You had
mentioned earlier on that you have so far been doing this conversion
with GhostScript - what is it that you need the CCITTFAX3 images for?
--
Cameron Hayne (email@hidden)
Hayne of Tintagel
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.