8 Replies
      Latest reply on Jan 8, 2020 11:04 PM by FrankSchlegel
      rowlands Level 1 Level 1 (0 points)

        I have a customer who has a 2010 Mac Pro running macOS 10.14.6, this customer is trying to use my application with RAW images from their Nikon camera ( 8256 x 5504 ).

         

        The customer gets an image at the correct size, but with only 1 row of pixels, the rest is black. When I test the images on a 2012 MBPr, it works fine, or a 2015 MacBook, it also works.

         

        The customer also tried an image that is 8166 x 5302 and that works for them. When my app does it's processing, it logs as much information about the CIContext as possible, including [CIContext inputImageMaximumSize] and [CIContext outputImageMaximumSize], which both report 16384 x 16384, yet the context doesn't return the results I'd expect when the images exceed 8192 x 8192 on this customers machine.

         

        I am leaning towards the idea that the macOS is returning incorrect information and the graphic card on their Mac Pro doesn't actually support anything higher than 8192 x 8192.

         

        If it helps, here is the log from the context.

                      priority: default
                      workingSpace:  (kCGColorSpaceICCBased; kCGColorSpaceModelRGB; Generic HDR Profile)
                      workingFormat: RGBAh
                      downsampleQuality: High max sizes, in{16384 x 16384} out{16384 x 16384}

         

        Any ideas or suggestions?

         

        To create the context it calls [CIContext context].

        To create the data it calls [CIContext render:toBitmap:rowBytes:bounds:format:colorSpace:]

        • Re: CIContext reports that it supports images in and out up to 16384 x 16384, but I think that it does.
          rowlands Level 1 Level 1 (0 points)

          Stupid forum software cut off the first line from the log report.

           

          <CIContext: 0x600003c57100 (metal-DG 738) MTLDevice=0x10d019000>

                        priority: default

                        workingSpace: <CGColorSpace 0x600001a44720> (kCGColorSpaceICCBased; kCGColorSpaceModelRGB; Generic HDR Profile)

                        workingFormat: RGBAh

                        downsampleQuality: High max sizes, in{16384 x 16384} out{16384 x 16384}

          • Re: CIContext reports that it supports images in and out up to 16384 x 16384, but I don't think that it does.
            FrankSchlegel Level 3 Level 3 (120 points)

            Hi Sam,

             

            I can only guess, but is this maybe an issue that is caused by tiling?

            If an image exceeds a certain size, Core Image will process the image in tiles and stitch them back together in the end. Maybe some filter in the chain doesn't handle this case very well (e.g., by supplying the wrong region of interest)?

             

            Have you tried processing a very large (close to 16384 pixels) image on your machine? That should trigger the tiling even on newer hardware.

              • Re: CIContext reports that it supports images in and out up to 16384 x 16384, but I don't think that it does.
                rowlands Level 1 Level 1 (0 points)

                Hi Frank,

                Your point on tiling might well be spot on, while for this test I am not doing any tiling myself, I wonder if it's CoreImage's own tiling system is incompatible with the 2010 Mac Pro. I have no idea what resolution Core Image auto tiles or the size of the tiles. I wonder if I try manually tiling the image via a CIImageAccumulator (like I did for my complex filters) if that would help.

                 

                I am not doing anything fancy with Core Image for this test, simply creating a CIImage from a CGImage, applying the CILinearToneCurveTosRGB and then getting the pixel data back via [CIContext render:toBitmap:rowBytes:bounds:format:colorSpace:] I have also tried creating a CIContext from a CGBitmapContext and drawing the CIImage into the CIContext (so I can get at the RAW pixels), but that yields the same result, 1 row of pixels and the rest is black.

                 

                I am amazed that this customer has the patience to persist with me, while I been trying a great many things, but no luck in solving it for them (doesn't help that I am not able to reproduce it here).

                 

                These kind of issues with Core Image are simply driving me nuts.