Giter VIP home page Giter VIP logo

Comments (3)

kean avatar kean commented on July 23, 2024

Thanks for reporting it and providing the details to reproduce it!

I'm not sure if that is the actual correct fix, and assuming it might break some other format

This line was introduced in order to address the following issues: #782 (comment). I think there is something I'm missing.

from nuke.

kean avatar kean commented on July 23, 2024

Fixed in v12.7.2.

RCA

It was a regression introduced in v12.7 in the scope of the fix for #782.

In 12.7.0, I added the following line to the code that specified the alpha info for CGContext:

        if image.bitsPerPixel == 8 {
            return .none // The only pixel format supported for grayscale CS
        }

I assumed that 8 bpp was only valid for grayscale color spaces, but forgot about the packed pixel formats (kCGImagePixelFormatPacked).

The new version has an additional condition:

        if colorSpace.numberOfComponents == 1 && image.bitsPerPixel == 8 {
            return .none // The only pixel format supported for grayscale CS
        }

I can't say that I'm an expert in pixel formats, so if someone else could review it, that would be fantastic. I'm also open to suggestions for how to improve it.

Debug

Here's some more information from CoreGraphics if you turn the debug flags on:


<CGImage 0x10460eff0> (IP)
	<<CGColorSpace 0x60000260d7a0> (kCGColorSpaceIndexed; base <CGColorSpace 0x60000260d320> (kCGColorSpaceICCBased; kCGColorSpaceModelRGB; sRGB IEC61966-2.1))>
		width = 1200, height = 642, bpc = 8, bpp = 8, row bytes = 1200 
		kCGImageAlphaNone | 0 (default byte order)  | kCGImagePixelFormatPacked 
		is mask? No, has masking color? No, has soft mask? No, has matte? No, should interpolate? Yes


CGBitmapContextCreate: unsupported parameter combination:
 	RGB 
	8 bits/component, integer
 	2272 bytes/row
	kCGImageAlphaNone
	kCGImageByteOrderDefault
	kCGImagePixelFormatPacked
	Valid parameters for RGB color space model are:
	16  bits per pixel,		 5  bits per component,		 kCGImageAlphaNoneSkipFirst
	32  bits per pixel,		 8  bits per component,		 kCGImageAlphaNoneSkipFirst
	32  bits per pixel,		 8  bits per component,		 kCGImageAlphaNoneSkipLast
	32  bits per pixel,		 8  bits per component,		 kCGImageAlphaPremultipliedFirst
	32  bits per pixel,		 8  bits per component,		 kCGImageAlphaPremultipliedLast
	32  bits per pixel,		 10 bits per component,		 kCGImageAlphaNone|kCGImagePixelFormatRGBCIF10|kCGImageByteOrder16Little
	64  bits per pixel,		 16 bits per component,		 kCGImageAlphaPremultipliedLast
	64  bits per pixel,		 16 bits per component,		 kCGImageAlphaNoneSkipLast
	64  bits per pixel,		 16 bits per component,		 kCGImageAlphaPremultipliedLast|kCGBitmapFloatComponents|kCGImageByteOrder16Little
	64  bits per pixel,		 16 bits per component,		 kCGImageAlphaNoneSkipLast|kCGBitmapFloatComponents|kCGImageByteOrder16Little
	128 bits per pixel,		 32 bits per component,		 kCGImageAlphaPremultipliedLast|kCGBitmapFloatComponents
	128 bits per pixel,		 32 bits per component,		 kCGImageAlphaNoneSkipLast|kCGBitmapFloatComponents
See Quartz 2D Programming Guide (available online) for more information.

from nuke.

zachwaugh avatar zachwaugh commented on July 23, 2024

Thanks for the quick fix!

from nuke.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.