Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Visual artifacts in image when writing to disk



Gidday,

I have an application that takes video from a camera and writes it to a jpeg file on disk when a flag is set in the Quartz Composition as well as showing the image live. The image from the camera is fed through an accumulator so it can be frozen at any point in time.

JPEG image


In the past it has worked fine on my PowerBook G4 without any visual artifacts. However when using a Mac Mini Core Duo, while the image shown on the screen live looks fine, when it is saved to file it suddenly introduces strange visual artifacts (see attached). The problem can be mitigated by increasing the shutter speed of the camera, but I find it strange that the image on screen (on the powerbook and mini) displays none of these artifacts.


Is there a way to fix this problem in software?

Here is the code I am using to write the image to disk:

NSImage * image = [[view valueForOutputKey:@"image"] copy];
NSData *imageData = [image TIFFRepresentation];
NSBitmapImageRep *imageRep = [NSBitmapImageRep imageRepWithData:imageData];
NSDictionary *imageProps = [NSDictionary dictionaryWithObject: [NSNumber numberWithFloat:0.9] forKey:NSImageCompressionFactor];
imageData = [imageRep representationUsingType:NSJPEGFileType properties:imageProps];
[imageData writeToFile:file atomically:YES];



Any help solving this is greatly appreciated.

Caleb


JPEG image

JPEG image

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.