(This was originally posted to the Colorsync-dev list about three weeks ago 
without any activity on the list, so I'm hoping that someone here can help)

I have an app that is essentially creating a single resultant image from an 
amalgamation of multiple source images.  Each source image is an NSImage that 
has a single NSBitmapImageRep which carries with it color profile data in its 
NSImageColorSyncProfileData property.

The effective algorithm is:

        NSBitmapImageRep* getBitmapOfImages(NSArray* imagesArray, NSSize 
bitmapSize)
        {
                NSBitmapImageRep* bitmap = [[[NSBitmapImageRep alloc] 
initWithBitmapDataPlanes: NULL
                                                                                
    pixelsWide: bitmapSize.width
                                                                                
    pixelsHigh: bitmapSize.height
                                                                                
 bitsPerSample: 8
                                                                               
samplesPerPixel: 4
                                                                                
      hasAlpha: YES
                                                                                
      isPlanar: NO
                                                                                
colorSpaceName: NSCalibratedRGBColorSpace
                                                                                
   bytesPerRow: 0
                                                                                
  bitsPerPixel: 0] autorelease];

                NSGraphicsContext* bitmapGraphicsContext   = [NSGraphicsContext 
graphicsContextWithBitmapImageRep:bitmap];
                NSGraphicsContext* originalGraphicsContext = [NSGraphicsContext 
currentContext];
                [NSGraphicsContext setCurrentContext:bitmapGraphicsContext];

                for (NSImage* image in imagesArray)
                {
                        NSRect imageRect = /* calculate rect for particular 
source image */;
                        [image drawInRect:imageRect ...];
                }

                [NSGraphicsContext setCurrentContext:originalGraphicsContext];

                return bitmap;
        }


The issue I am experiencing is that the color of the resultant image generated 
by my application when printed does not match the color of the source image 
when printed from another application (which is in this case Aperture).

What attributes do I need to use when creating the destination bitmap so that 
the color of each source image is rendered properly for that source image when 
the destination image is printed?  Or is there a deeper issue that I am not 
addressing here?


_______________________________________________

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