0

I have been facing a problem during conversion in RGB image to CMYK image. I know that the color gamut of these color space are not same. I would like to request you ,could you able to provide the basis algorithm of RGB to CMYK color space, so that I would able understand the conversion process, which will really helpful for my work. Thanking you. With Regards I.Das

closed as off-topic by Scott, Rafael, Luciano, Ovaryraptor, WELZ Feb 8 at 22:01

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    You would need to ask Adobe about their algorithm.. and it's just my guess, but I would imagine they consider that proprietary and not open to the public. – Scott Feb 8 at 11:01
  • What do you mean by an algorithm? Are you a programmer? Are you making an application to emulate the mode conversion? Are you a graphic designer? Are you neither and you are simply converting color modes? The question as it means reverse engeneering of Adobe's mode conversion algorithm. – Rafael Feb 8 at 12:17
3

I assume that you already know RGB numbers control how much red, green and blue light are produced in a pixel of RGB screen. I also assume that you know CMYK numbers control how much cyan, magenta, yellow and black inks are inserted onto paper to make it colored or darker or both. I assume you expect a couple of formulas to convert RGB --> CMYK or reversed. Just two clear and exact formulas with no blahblah.

Unfortunately the blahblah starts now, because there's no unique conversion method. Every RGB display has its own color space (=the collection of produceable colors) and every CMYK print process has its own. You must know the used RGB version and the used CMYK version before any really useful conversion is possible between RGB numbers and CMYK numbers.

You can argue that Photoshop asks nothing, but changes the colors in a second when one changes the used color mode from RGB to CMYK or vice versa. Used versions are hidden to the color settings which define "color management". You find there numerous RGB and CMYK profiles, which actually are complex pieces of computer software and define which is the connection between RGB or CMYK numbers and exact produced (=measured) colors. Photoshop actually even has one color mode which presents measured colors. It's Lab.

To make this all a little more confusing Photoshop can take into the account 4 color profiles in the same time. They are

  • one for the camera which took the photo
  • one for the space where your current photoshop job lives
  • one for your becoming print process
  • one for how your monitor displays colors

The last one is actually in the computer operating system. You must calibrate your monitor if you want to have it right. The first one comes as written into the photo file.

You can easily find quick and dirty conversion formulas such as https://www.rapidtables.com/convert/color/rgb-to-cmyk.html and https://www.rapidtables.com/convert/color/cmyk-to-rgb.html

They do not at all take into the account the used devices. They have a reasonable principle to select as high percentage of black ink K as possible to remove redundant C, M and Y inks and they surely show white paper with no ink at all when R=G=B=255. But for any realistic print preparation those formulas are poor. They assume a CMYK system which can produce exactly the same colors as your RGB screen and make a linear transformation between them (=linear after inserting as much K as possible).

In reality the used conversion must be highly non-linear for decent results. That non-linearity is written into color profiles.

When you understand all this, you may also understand why Adobe collects millions and millions despite the existence of GIMP. The latter knows nothing of CMYK printing altough it allows you to set colors with CMYK numbers.

0

I am not sure you understand the question. I will try more than answering it, to explain what must be understood about color modes.

  1. RGB and CMYK are not really color spaces, they are color modes. But I will not dive into it too deep.

  2. The conversion from RGB to CMYK should be made ONLY if you need it, which making a totally imaginary loose guess is a tiny fraction of the times people think they should. Imagine there are 100 color printers in peoples offices, homes, etc. They all most likely do NOT need, and should not use CMYK.

    2.1 You only need it if you are using some specific specialized printing service, normally for mass production, like offset sheeted lithography, or in some really limited cases some specific commercial digital services... (Which I have almost never encountered)

  3. The RGB to CMYK in these particular cases (see 2.1) is not to cause problems... it is to solve them. The conversion is not meant to "Lose colors", it is meant to "simulate them when printed on a limited (printed) medium"

  4. This "simulation" is made accordingly to some stuff called color profile, which is a series of parameters (matrixes and functions) to control the conversion which renders two things...

    4.1 The amount of ink each plate (CMY&K) should have... according to a set of rules, for example, maximum accepted ink on the paper (or medium) TAC (Total area of Coverage), Dot gain, type of paper, absorption of ink, brand of ink (or the intended specification), transparency of it, etc.

    4.2 How to simulate this on your application so you have an idea how it will look when printed.

  5. As these conversions imply a squishy-squashy of the shape of the "color solid" there are different sub-methods to do it, depending on what do you want to preserve more. Colorimetric, relative colorimetric, relative something stuff vs some other colorimetric something stuff.

  6. The conversion also can imply jumping into a 3rd color mode, Lab for example.

  7. But you also can make some other conversions, like swapping RGB to CMY channels, changing the number of inks involved, and a big etcetera.


Sayed that... No. I do not know how the "algorithm" works None of the previous is the algorithm... (the algorithm uses these parameters) But I do not need it. I only need to understand when to use what. :o)

0

You need to implement a color management system. Photoshop does not really do the color conversion it asks a CMS to do it for Photoshop. The system allows you to choose which CMS to use. You can use Adobes CMS, apples CMS, microsofts CMS etc...

You should also defer the job to a CMS engine. Why? Well because you will need to implement color profile to color profile conversion. This is quite much work since you need to write a tool that can undstand and execute different versions of ICC profile standards. Since each ICC profile is sort of a mini programming language, or at least a complex format, so this task is time consuming.

We simply can not give a formula. Because there is no formula. There is a system that allows you to describe the system you have and letting the system combine 2 of these formulas for a transform. You need the entire system.

Use your operating systems CMS, or use something like tiny CMS.

Not the answer you're looking for? Browse other questions tagged or ask your own question.