Message Boards Message Boards

Can ChromaticityPlot3D be made faster?

Posted 2 years ago

I have been doing work in Mathematica which involves visualizing the extent to which photographic images fit within printing process color gamuts. A primary tool for this is ChromaticityPlot3D. I plot both the printer gamut and image pixel values in the same plot to examine the fit.

The only real problem with this is speed of execution. If I plot all the image points it can take tens of minutes. I reduce the number of points to 10000, assuming this will sample my image on a 100x100 grid. (It's not documented how the subset of points is chosen, but this seems reasonable.)

The result s that converting each of 10000 points RGB values to CIE coordinates and plotting the result takes 55 seconds. During the execution, the Windows 10 Resource Monitor reports 18% CPU utilization with no GPU activity. That's 5.5 ms per point.

It appears Mathematica is partially using one core on my four core laptop. I tried to Parallelize the function, but Mathematica declined.

For reference, here is statement evaluated. (But I did not attach the image or profile due to size.)

ChromaticityPlot3D[{fujiPearlProfile, testImage}, 
 MaxPlotPoints -> maxPlotPoints, 
 FillingStyle -> {Opacity[1], Opacity[1]}, 
 Appearance -> "VisibleSpectrum", ViewPoint -> viewPoint]

Can anyone suggest a way to speed this up?

POSTED BY: David Keith
2 Replies

Color conversion using external profiles is very slow. I would suggest to plot fujiPearlProfile, save it and then combine it with a separate plot for each image using Show.

Posted 2 years ago

Thank you, Giulio. You are quite right.

  • Plotting the printer profile and the image with MaxPlotPoints->10000 requires 68 seconds.

  • The profile alone requires 65 seconds.

  • The image alone 0.4 seconds.

  • When I try to plot the image (from a 24 MPix camera) with MaxPlotPoints->Infinity, I get a fatal error: "An unknown box name (ToBoxes) was sent as the BoxForm for the expression. Check the format rules for the expression" and the kernal quits.

I will stick to fewer points, since they do seem to reasonably sample the image. However, my real application is to look at how a single image is handled by multiple profiles. I'm looking for the process that best handles all the colors in the image. So I think I'll have to be satisfied with at least a minute of processing time for each trial.

Thanks again and kind regards, David

POSTED BY: David Keith
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract