Stripping alpha channel from an NSImage
Stripping alpha channel from an NSImage
- Subject: Stripping alpha channel from an NSImage
- From: Ben Mackin <email@hidden>
- Date: Fri, 28 Mar 2003 11:38:02 -0800
I am trying to save out my tiff as just an RGB image, not an RGBA. The input
image is a PDF file as stored on my HD, but if I change the input to a TIFF
(with no alpha, just RGB), I still get the same result. When I do the
following:
myData = [theImage TIFFRepresentation];
[myNewData writeToFile:@"/here.tif" atomically:YES];
I get a 4 SPP image. I don't see how I can change it easily, either. Someone
awhile back was helping me out a bit with something else, and gave me some
sample code. The only problem is that it takes about 5 seconds on a US
letter sized image (on a 867 MHz desktop) to go through and strip out the
alpha. So if anyone has a quicker method, I would be much appreciated.
My ultimate goal is to convert the image to grayscale (I was planning on
using tiff2bw part of the libtiff package), but that requires the image to
have no alpha.
Thanks,
Ben
_______________________________________________
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.