diff --git a/SilicaViewer/Document.swift b/SilicaViewer/Document.swift index f6c405c..2c47245 100644 --- a/SilicaViewer/Document.swift +++ b/SilicaViewer/Document.swift @@ -240,7 +240,7 @@ class Document: NSDocument { return .luminosity } - return .sourceAtop + return .sourceOver } func parseSilicaLayer(archive: Archive, dict: NSDictionary, isMask: Bool) -> SilicaLayer? { @@ -320,7 +320,7 @@ class Document: NSDocument { let render: CGColorRenderingIntent = .defaultIntent let rgbColorSpace = isMask ? CGColorSpaceCreateDeviceGray() : info.colorSpace - let bitmapInfo = CGBitmapInfo(rawValue: (isMask ? CGImageAlphaInfo.none : CGImageAlphaInfo.last).rawValue).union(.byteOrder32Big) + let bitmapInfo = CGBitmapInfo(rawValue: (isMask ? CGImageAlphaInfo.none : CGImageAlphaInfo.premultipliedLast).rawValue).union(.byteOrder32Big) let providerRef: CGDataProvider? = CGDataProvider(data: imageData as CFData) guard let cgimage = CGImage(width: width, height: height, bitsPerComponent: 8, bitsPerPixel: 8 * numChannels, bytesPerRow: width * numChannels, space: rgbColorSpace, bitmapInfo: bitmapInfo, provider: providerRef!, decode: nil, shouldInterpolate: false, intent: render) else { @@ -504,9 +504,7 @@ class Document: NSDocument { var maskContext: CGContext? let kernel = getBlendKernel(layer) - - Swift.print(layer.name + " is " + kernel!.name) - + if layer.mask != nil { let grayColorSpace = CGColorSpaceCreateDeviceGray() let maskBitmapInfo = CGBitmapInfo(rawValue: CGImageAlphaInfo.none.rawValue).union(.byteOrder16Big)