• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Creating black and white image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating black and white image


  • Subject: Re: Creating black and white image
  • From: Osamu Shigematsu <email@hidden>
  • Date: Thu, 23 Dec 2004 04:57:25 +0900

Thank you very much for your information.

I read NSImage_monochrom.m, but this sample computes color of all pixels.

With QuickTime, converting color depth (dithering), resizing (affine transform) are done in single function call.

I hope NSImage's -compositeToPoint:operation:fraction: does that work, but converting depth does not work well.

I added following lines at the end of my bitmap creating function, and checked the output. The image size (dpi) was changed, but it was color image. The image (dst) has only one Image Representations, or 1 bit depth NSBitmapImageRep.

NSData *tiff = [dst TIFFRepresentation];
[tiff writeToFile:[@"~/Desktop/test.tif" stringByExpandingTildeInPath] atomically:NO];


Anyway, the performance of NSReadPixel may not good, and the code of NSImage_monochrom.m is too long for it's feature. I will try to create NSBitmapImageRep from QuickDraw's PixMapHandle.

This might be not so cool, but code will be simple.

On Dec 23, 2004, at 4:09 AM, Ricky Sharp wrote:

Check out the following example:

<http://developer.apple.com/samplecode/Monochrome_Image/ Monochrome_Image.html>

Specifically, look at the NSImage_monochrom.m file.

Note that the code uses NSReadPixel which is quite slow. I've since optimized a local copy of it by directly accessing the pixels. I hope to one day submit this code. Currently, it doesn't yet support bitmap reps that contains alpha or is planar.

--
Osamu Shigematsu

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Creating black and white image (From: Osamu Shigematsu <email@hidden>)
 >Re: Creating black and white image (From: Chuck Soper <email@hidden>)
 >Re: Creating black and white image (From: Osamu Shigematsu <email@hidden>)
 >Re: Creating black and white image (From: Ricky Sharp <email@hidden>)

  • Prev by Date: Re: Renaming files?
  • Next by Date: Re: Renaming files?
  • Previous by thread: Re: Creating black and white image
  • Next by thread: Re: Creating black and white image
  • Index(es):
    • Date
    • Thread