but after that, it’s as if the colorspace doesn’t exist.
There are no subclasses of GMColorMBS that involve CMYK, so Im unsure how I could work with such an object.
In terms of straight Xojo, I know I can create a color using CMY(…) like I can with RGB(…)
I cant find any way to create a picture, draw in CMYK colors, and save an image (preferably TIF) with a CMYK colorspace attribute. Am I missing something?
Dim pic As Picture = LogoMBS(500)
Dim g As New GMImageMBS(pic)
g.type = g.ColorSeparationType
Dim file As FolderItem = SpecialFolder.Desktop.Child("test.tif")
g.write(file)
This is very high level and may need some configuration.
Also without ICC profiles, it may not be good.
You may want to look into the LCMS examples we have and the Tiff classes.
They send images to printers, printers ask for CMYK because that’s how their big machines are set up.
Either they cant be bothered to press some button that says ‘here comes an RGB image, deal with it’,
or (more likely) there is a color shift when doing the conversion which they want to avoid.
I don’t understand it all, personally.
But I’m 'that sucker who spends 3 non-chargeable weeks coding something to save 4 users from having to click twice’
Oh my gosh… you should avoid getting tangled up in this if you can. The printer should be competent enough to configure their output systems to properly covert trashed RGB data to the correct CMYK data specific to their output device, using an appropriate color profile.
But that means you need to tag your RGB data with an accurate color profile. sRGB would be a good starting point. It’s possible that if you are sending untagged RGB that their systems are making incorrect assumptions about it and causing output problems.
If its a digital press then the RIP should be able to handle RGB output as long as it has been generated correctly.
Do you embed a ICC Profile in the RGB files you currently generate today? If not, then this could account for the colour shift.
Do you know if the colours you are generating are actually printable (its quite common for printing devices to only support a subset of colours that you can generate with RGB).
If your answer is no to the above then I would try and resolve those first to see if you can get your RGB output good enough.
If you really need to do CMYK then be prepared for a lot of work. For starters, you more than likely won’t be able to use any of the Xojo framework for drawing so you will need to find an alternative that can draw images / text / vector graphics in the CMYK colour space. You mentioned trying to use GraphicsMagick. A quick Google seems to indicate that ImageMagick / GraphicsMagick only draws in RGB but that information could be out-of-date.
An alternative might be to use DynaPDF as this would allow you to draw text and vector objects in a device specific colour space and also embed RGB images. The above rules regarding ICC Profiles / out of gamut colours would still apply though.
If you use JPEGExporterMBS or TiffPictureMBS you can attach an sRGB ICC Profile to the data.
This obviously means you need an sRGB ICC Profile. There are files available online and probably on your hard disk. An alternative could be to generate one via LCMS2ProfileMBS.CreateSRGBProfile.
Here is a very basic example of exporting a picture as a JPEG with an sRGB profile attached.
Dim sourcePicture As Picture
Dim iccProfileObj As LCMS2ProfileMBS
Dim jpegExporterObj As JPEGExporterMBS
iccProfileObj = LCMS2ProfileMBS.CreateSRGBProfile
sourcePicture = New Picture(100, 100, 24)
sourcePicture.Graphics.ForeColor = RGB(255, 0, 0)
sourcePicture.Graphics.FillOval(0, 0, sourcePicture.Width, sourcePicture.Height)
jpegExporterObj = New JPEGExporterMBS
jpegExporterObj.Picture = sourcePicture
jpegExporterObj.ProfileData = iccProfileObj.SaveProfileToString
jpegExporterObj.File = SpecialFolder.Desktop.Child("TestWithProfile.jpg")
jpegExporterObj.Export
If you open the image in a graphics package it should state that it has an ICC Profile attached.
Note that he said “multiple customers” which suggests “multiple printers” which further implies “multiple output devices” and “multiple color profiles”. Tagging his RGB files with a color profile is the best approach here.
What’s the content being drawn, by the way? Photographs? Graphs? Lines and text?
I imagine you would have to speak to your customers to see which colours are still affected after they have printed some of your ICC Profile tagged files. Please be aware that this could be different for each customer as printing equipment, ink and paper all impact this.
If you want to see the impact on RGB colours when converted to CMYK you can experiment with the calculator option in the macOS ColorSync utility. This allows you to choose a RGB profile, a RGB colour, a CMYK profile and see how the colour is affected. NOTE. I did notice a bug in the utility where changing the CMYK profile didn’t update the result until the RGB colour values were changed.
Solid colors, text, lines… think Powerpoint stuff, but with a need to represent a real-world color match.
Which is of course ludicrous when you cross the screen to print threshold, as the color management is totally different.
If the image contains color profile in it then Color profile plugin either from Christian or me for example would convert it to your screen profile, or sRGB if that was fitting or wanted.
Will they accept a PDF? You might have better results if you send them tagged vector data. Although I don’t have much confidence that Xojo’s built-in PDF support will be up to the task.
What’s your source for the colors that need to be matched? RGB values? Pantone color spec? Something else?
Yeah. Not an option.
But I need to say- this isn’t a commission job.
This is to cater for a few customers of an ‘off-the-shelf’ tool, who feel that this is a ‘feature request’
I don’t want to actually spend weeks doing something which doesn’t provide a benefit for the majority of users, and the people who want this aren’t wanting to pay actual money for customisation.
So my first port of call is to work out how to get a profile into that TIF file.
At the moment, I’m saving as TIF from GMImageMBS
But I can look into switching to TIFFPictureMBS which I do use in another part of my app
ImageMagick could do this for you as well from the command line. If I were you, I would send these customers a file where you’ve manually assigned the profile with some tool to make sure it meets their needs before investing in any code changes.