CMYK 색상 공간에 CGImage가 있습니다 (즉, CGImageGetColorSpace를 통해 쿼리 할 때 CGColorSpaceGetModel이 kCGColorSpaceModelCMYK를 반환합니다).CGImageDestination은 CMYK 색상 공간을 RGB로 저장합니다.
그러나 CGImageDestination을 통해 저장하려고하면 RGBColorSpace로 변환됩니다. 올바른 선택 값을 설정하려고했지만 아무 소용이 없습니다. 어떻게 알 수 있습니까? 미리보기로 저장된 이미지를 열면 일반 정보 탭에서 'ColorModel : RGB'및 '프로필 이름 : 일반 RGB 프로파일'이라고 알려줍니다. CGImageSource로 저장된 파일을 열고 속성을 읽으면 동일한 결과 (RGB 색상 모델, 일반 RGB 프로파일)가 나타납니다.
마지막으로 마지막 머리를 잃기 전에 (단수), 제 질문은 : 의도적입니까? ImageIO는 RGB 이외의 형식으로 이미지를 저장할 수 없습니까? 킥을 위해서 L * a * b 색상 공간을 사용하여 동일한 결과를 얻었으며 같은 결과를 얻었습니다. 내가 바라 보는거야 분명
BOOL saveImage(CGImageRef theImage, NSURL *fileDestination, NSString *theUTI)
{
CGImageDestinationRef imageDestination = CGImageDestinationCreateWithURL((__bridge CFURLRef)fileDestination, (__bridge CFStringRef) theUTI, 1, nil);
// now assemble the dictionary for saving
NSMutableDictionary *theDict = nil;
theDict = [[NSMutableDictionary alloc] initWithCapacity:10];
[theDict setObject:[NSNumber numberWithFloat:hdpi] forKey: (id) kCGImagePropertyDPIHeight];
[theDict setObject:[NSNumber numberWithFloat:vdpi] forKey: (id) kCGImagePropertyDPIWidth];
}
// now make sure that we have the correct color space in the dictionary
NSString *colorModel = nil;
CGColorSpaceRef theColorSpace = CGImageGetColorSpace(theImage);
CGColorSpaceModel theModel = CGColorSpaceGetModel(theColorSpace);
switch (theModel) {
case kCGColorSpaceModelRGB:
colorModel = kCGImagePropertyColorModelRGB;
break;
case kCGColorSpaceModelLab:
colorModel = kCGImagePropertyColorModelLab;
break;
case kCGColorSpaceModelCMYK:
colorModel = kCGImagePropertyColorModelCMYK;
break;
default:
colorModel = kCGImagePropertyColorModelRGB;
break;
}
[theDict setObject:colorModel forKey:(id) kCGImagePropertyColorModel];
// Add the image to the destination, characterizing the image with
// the properties dictionary.
CGImageDestinationAddImage(imageDestination, theImage, (__bridge CFDictionaryRef) theDict); //properties);
BOOL success = (CGImageDestinationFinalize(imageDestination) != 0);
CFRelease(imageDestination);
return success;
}
이 있어야 뭔가 :
여기 내 저장 코드입니다. 이 기능을 사용하려면 몇 가지 kCFSuperSecretProperty를 설정해야합니까? 또는 ImageIO가 단순히 CMYK로 저장되지 않습니까? 그 요인 경우
아, 내가 총알을 비트 애플의 엔지니어링 도움을받을 수 사건을 사용