Xojo picture object NEEDS to support color profiles

For the last 6 weeks, as well as everything else going on here, I’ve been building a new web page for my product. For each image, I have to create 4 variant (because I want support mobile and desktop and different resolutions). So naturally I wrote myself a little app to do this for me.

Yesterday, I discovered when testing this site in different browsers on the same machine, the images would render differently (in terms of colors). A quick peek into the Xojo created images and their color profiles were set to “Generic RGB”. Oh no!

Replaced the Xojo functions with CoreGraphics functions, to set the color profile to sRGB and low, all is well again. Now I just need to recreate all the the images :frowning:

Setting the color profile to be sRGB even helped clear up some image issues we were getting across across different hardware and different OS versions, nice!

As I can’t log-in to Feedback and I don’t want to forget this, I’ve filed it here for the time being. I want to be able to create my apps in a more x-plat way, reducing my reliance on Apple, but issues like this make it much harder to do so.

It’s also about time Xojo supported meta data with images, after all it’s supported by the OS when reading or writing images and to do image manipulation with Xojo (on a semi-professional level) it’s required.

MBS Xojo Plugins come with a ton of functionality for color spaces including platform specific stuff For MacOS and Windows as well as LCMS for cross platform things. And for a lot of stuff you best make a proper PDF with colorspaces embedded.

Xojo’s pictures are all Generic RGB color space on MacOS and we have a few examples to convert whatever color space you have to Generic RGB and back.

Xojo do not even have a CLUT access !

We table do you want to use?

It does sorta! RGBTransform can be used to do some CLUT like functionality.

Otherwise; with some declares you can drop a Xojo Picture into Core Image and uses CLUTs there, or get the pixels as memory block and manually loop through (I wouldn’t actually recommend you manually process images with CLUTs until we get proper multicore processing).

RGBSurface.Transform :
Not a single occurence of the CLUT term…

But yes, something exists. Think at Joe Newbie (Geoff actual best friend)…

For more details, you can read Palette_(computing) .

Asking for CLUT @ wikipedia returns that page.

The Transform function can be used for quite a few things, but you must remember that it’s a “Channel” Lookup table, not a pixel lookup table. Which means that it interacts with each channel separately.

Where as a pixel lookup table, simple swaps each pixel. These are fast to apply complex effects, but they’re slow to generate in native Xojo code. You can of course write a plugin to do the generation in Objective-C (or Swift) and across multiple cores (0.3 seconds becomes 0.08 or less), but that means you have to use a different tool and suffer the complications arising from that.

I can see the benefit for video editing (generate once, apply 1000s of times), but for photo editing, sometimes it’s faster to do the actual calculations, than generate a LUT and apply it.